From 845288d8611727f72fe06a57e15b1442bc4438c0 Mon Sep 17 00:00:00 2001 From: Alexander Bigga Date: Tue, 16 Jul 2024 19:14:00 +0200 Subject: [PATCH] Improve fullwidth container (#669) --- sass/_layout.scss | 5 +++++ sass/_variables.scss | 2 +- sass/wp-blocks/group.scss | 26 +++++++++++--------------- src/latest-posts/render.php | 4 ++-- src/next-events/block.json | 4 +++- theme.json | 14 +++++++++++++- 6 files changed, 35 insertions(+), 20 deletions(-) diff --git a/sass/_layout.scss b/sass/_layout.scss index 64893656..1251b87d 100644 --- a/sass/_layout.scss +++ b/sass/_layout.scss @@ -246,6 +246,11 @@ iframe { opacity: 0.3; background-color: $black; } + + .wp-block-group__inner-container { + position: relative; + } + } } diff --git a/sass/_variables.scss b/sass/_variables.scss index acdf6578..4d6795bb 100755 --- a/sass/_variables.scss +++ b/sass/_variables.scss @@ -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; diff --git a/sass/wp-blocks/group.scss b/sass/wp-blocks/group.scss index 3f3a9217..671f7224 100644 --- a/sass/wp-blocks/group.scss +++ b/sass/wp-blocks/group.scss @@ -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"); } } diff --git a/src/latest-posts/render.php b/src/latest-posts/render.php index 76133549..be3662a6 100644 --- a/src/latest-posts/render.php +++ b/src/latest-posts/render.php @@ -83,7 +83,7 @@ $sunflower_list_items .= sprintf( ' -
+
%2$s
@@ -92,7 +92,7 @@ ( $attributes['archiveText'] ?? '' ) ? ( $attributes['archiveText'] ?? '' ) : __( 'to archive', 'sunflower-latest-posts' ) ); -$sunflower_list_items .= '
'; +$sunflower_list_items .= ''; echo wp_kses( $sunflower_list_items, diff --git a/src/next-events/block.json b/src/next-events/block.json index b13bdfaf..18822496 100644 --- a/src/next-events/block.json +++ b/src/next-events/block.json @@ -30,7 +30,9 @@ } }, "supports": { - "html": false + "html": false, + "align": [ "full" ], + "alignWide": true }, "textdomain": "sunflower-next-events", "editorScript": "file:./index.js", diff --git a/theme.json b/theme.json index ddaf23da..d4d06416 100755 --- a/theme.json +++ b/theme.json @@ -3,6 +3,7 @@ "version": 3, "settings": { "appearanceTools": false, + "useRootPaddingAwareAlignments": true, "color": { "palette": [ { @@ -128,5 +129,16 @@ } ] } - } + }, + "styles": { + "spacing": { + "padding": { + "top": "0px", + "bottom": "0px", + "right": "2rem", + "left": "2rem" + } + } + } + }