Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve fullwidth container #669

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions functions/excerpts.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,3 @@ function sunflower_excerpt_length() {
}

add_filter( 'excerpt_length', 'sunflower_excerpt_length', 900 );

/**
* Change read_more link text.
*/
function sunflower_read_more_link() {
return '…';
}

add_filter( 'excerpt_more', 'sunflower_read_more_link', 910 );
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"
}
}
}

}