Skip to content

Commit

Permalink
Improve fullwidth container (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
albig committed Jul 16, 2024
1 parent 225907b commit 845288d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 20 deletions.
5 changes: 5 additions & 0 deletions sass/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ iframe {
opacity: 0.3;
background-color: $black;
}

.wp-block-group__inner-container {
position: relative;
}

}
}

Expand Down
2 changes: 1 addition & 1 deletion sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $container-max-widths: (
sm: 540px,
md: 720px,
lg: 960px,
xl: 1200px) !default;
xl: 1170px) !default;

$font-size-base: 1.1875rem;
$small-font-size: 15px;
Expand Down
26 changes: 11 additions & 15 deletions sass/wp-blocks/group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,26 @@

position: relative;

&.is-layout-flex {
gap: 0;
}

&.alignfull.has-background {
&.alignfull {
width: 100vw;
display: flex;
justify-content: center;
flex-wrap: wrap;
flex-direction: column;

margin-left: calc(50% - 50vw);
margin-right: calc(50% - 50vw);
padding-left: 5vw;
padding-right: 5vw;

@include media-breakpoint-up(lg) {
padding-left: 10vw;
padding-right: 10vw;
@include media-breakpoint-down(xl) {
padding-left: 2rem;
padding-right: 2rem;
}

@include media-breakpoint-down(sm) {
padding-left: 1rem;
padding-right: 1rem;
}

@include media-breakpoint-up(xl) {
padding-left: 20vw;
padding-right: 20vw;
> p {
max-width: map-get($container-max-widths, "xl");
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/latest-posts/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
$sunflower_list_items .= sprintf(
'
<a class="text-white no-link d-block bg-primary has-green-550-hover-background-color border-radius" href="%1$s" rel="">
<div class="p-45 row ">
<div class="p-45 row">
<span class="continue-reading text-white text-center pt-0">%2$s</span>
</div>
</a>
Expand All @@ -92,7 +92,7 @@
( $attributes['archiveText'] ?? '' ) ? ( $attributes['archiveText'] ?? '' ) : __( 'to archive', 'sunflower-latest-posts' )
);

$sunflower_list_items .= '</div></div></div></div>';
$sunflower_list_items .= '</div></div></div>';

echo wp_kses(
$sunflower_list_items,
Expand Down
4 changes: 3 additions & 1 deletion src/next-events/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
}
},
"supports": {
"html": false
"html": false,
"align": [ "full" ],
"alignWide": true
},
"textdomain": "sunflower-next-events",
"editorScript": "file:./index.js",
Expand Down
14 changes: 13 additions & 1 deletion theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": 3,
"settings": {
"appearanceTools": false,
"useRootPaddingAwareAlignments": true,
"color": {
"palette": [
{
Expand Down Expand Up @@ -128,5 +129,16 @@
}
]
}
}
},
"styles": {
"spacing": {
"padding": {
"top": "0px",
"bottom": "0px",
"right": "2rem",
"left": "2rem"
}
}
}

}

0 comments on commit 845288d

Please sign in to comment.