Skip to content
Closed
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
1 change: 1 addition & 0 deletions packages/themes/block-theme/src/config/_index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "layout.css";
104 changes: 104 additions & 0 deletions packages/themes/block-theme/src/config/layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/**
* Configuration – Layout.
*/

.wp-site-blocks {
display: flex;
flex-direction: column;
min-height: 100%;

& * {
&:first-child {
margin-top: 0;
}

&:last-child {
margin-bottom: 0;
}
}

& > * {
margin: 0;
}

& > .content-wrapper {
flex: 1;
}

& > .footer-wrapper {
margin-top: var(--wp--preset--spacing--80);
}

&:has(.wp-block-post-content > .alignfull:last-child) .footer-wrapper {
margin-top: 0;
}
}

.entry-content > .wp-block-group > *,
.wp-block-post-content > *,
.wp-block-post-content.is-layout-constrained > * {
margin-bottom: 0;
margin-top: var(--wp--preset--spacing--80);

/* Core — Heading */
&.wp-block-heading,
&:is(h1, h2, h3, h4, h5, h6) {
& + * {
margin-top: var(--wp--preset--spacing--50);

&.alignfull {
margin-top: var(--wp--preset--spacing--80);
}
}

& + p,
& + .wp-block-list,
& + .wp-block-paragraph {
margin-top: var(--wp--preset--spacing--30);
}
}

/* Core — Image */
&.wp-block-image {
&:not(.alignfull) {
& + p,
& + .wp-block-paragraph {
margin-top: var(--wp--preset--spacing--60);
}

& + .wp-block-heading,
& + *:is(h1, h2, h3, h4, h5, h6) {
margin-top: var(--wp--preset--spacing--60);
}
}
}

/* Core — List */
&.wp-block-list {
& + p,
& + .wp-block-list,
& + .wp-block-paragraph {
margin-top: var(--wp--preset--spacing--30);
}

& + .wp-block-heading,
& + *:is(h1, h2, h3, h4, h5, h6) {
margin-top: var(--wp--preset--spacing--60);
}
}

/* Core — Paragraph */
&.wp-block-paragraph,
&:is(p) {
& + p,
& + .wp-block-paragraph,
& + .wp-block-list {
margin-top: var(--wp--preset--spacing--30);
}

& + .wp-block-heading,
& + *:is(h1, h2, h3, h4, h5, h6) {
margin-top: var(--wp--preset--spacing--60);
}
}
}
2 changes: 2 additions & 0 deletions packages/themes/block-theme/src/view.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "./config/_index.css";

/* Preferred box-sizing value */
*,
*::before,
Expand Down
6 changes: 1 addition & 5 deletions packages/themes/block-theme/t2.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"t2/accessibility-improvements",
"t2/allow-svg-uploads",
"t2/button-icon",
"t2/custom-block-margin",
"t2/disable-block-directory",
"t2/disable-comments",
"t2/disable-custom-css",
Expand All @@ -38,8 +37,5 @@
"t2/search-block-button-icon",
"t2/site-health-qa",
"t2/wrap-custom-html-block"
],
"t2/custom-block-margin": {
"version": 3
}
]
}
4 changes: 2 additions & 2 deletions packages/themes/block-theme/templates/404.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header","className":"header-wrapper"} /-->

<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-group">
<!-- wp:group {"tagName":"main","layout":{"type":"constrained"},"className":"content-wrapper"} -->
<main class="wp-block-group content-wrapper">
<!-- wp:heading {"level":1} -->
<h1 class="wp-block-heading" id="page-not-found">Page Not Found</h1>
<!-- /wp:heading -->
Expand Down
4 changes: 2 additions & 2 deletions packages/themes/block-theme/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header","className":"header-wrapper"} /-->

<!-- wp:query {"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-query">
<!-- wp:query {"tagName":"main","layout":{"type":"constrained"},"className":"content-wrapper"} -->
<main class="wp-block-query content-wrapper">
<!-- wp:query-title {"type":"archive","showPrefix":false,"align":"wide"} /-->

<!-- wp:post-template {"align":"wide","layout":{"type":"grid","columnCount":3}} -->
Expand Down
4 changes: 2 additions & 2 deletions packages/themes/block-theme/templates/search.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header","className":"header-wrapper"} /-->

<!-- wp:query {"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-query">
<!-- wp:query {"tagName":"main","layout":{"type":"constrained"},"className":"content-wrapper"} -->
<main class="wp-block-query content-wrapper">
<!-- wp:query-title {"type":"search","align":"wide"} /-->
<!-- wp:search /-->

Expand Down
6 changes: 5 additions & 1 deletion packages/themes/block-theme/templates/singular.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!-- wp:template-part {"slug":"header","area":"header","tagName":"header","className":"header-wrapper"} /-->
<!-- wp:post-content {"tagName":"main","align":"full","layout":{"type":"constrained"}} /-->
<!-- wp:group {"tagName":"main","layout":{"type":"constrained"},"className":"content-wrapper"} -->
<main class="wp-block-group content-wrapper">
Copy link
Member

@stian-overasen stian-overasen Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very unnecessary to wrap Post Content. You should target .is-layout-flow instead of .wp-block-group/.wp-block-post-content. There are a few additional container, like Media & Text, Columns, Factbox, Accordion Content etc, that also needs this that already have is-layout-flow in place.

<!-- wp:post-content {"align":"full","layout":{"type":"constrained"}} /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer","className":"footer-wrapper"} /-->
77 changes: 48 additions & 29 deletions packages/themes/block-theme/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,56 @@
"spacing": {
"blockGap": true,
"customSpacingSize": false,
"defaultSpacingSizes": true,
"defaultSpacingSizes": false,
"margin": false,
"padding": false,
"spacingSizes": []
"spacingSizes": [
{
"name": "4X-Small",
"slug": "0",
"size": "8px"
},
{
"name": "3X-Small",
"slug": "10",
"size": "clamp(0.5rem, 0.4391rem + 0.2591vw, 0.75rem)"
},
{
"name": "2X-Small",
"slug": "20",
"size": "clamp(0.75rem, 0.6891rem + 0.2591vw, 1rem)"
},
{
"name": "X-Small",
"slug": "30",
"size": "clamp(1rem, 0.8782rem + 0.5181vw, 1.5rem)"
},
{
"name": "Small",
"slug": "40",
"size": "clamp(1.5rem, 1.3782rem + 0.5181vw, 2rem)"
},
{
"name": "Medium",
"slug": "50",
"size": "clamp(2rem, 1.7565rem + 1.0363vw, 3rem)"
},
{
"name": "Large",
"slug": "60",
"size": "clamp(2rem, 1.6347rem + 1.5544vw, 3.5rem)"
},
{
"name": "X-Large",
"slug": "70",
"size": "clamp(3rem, 2.7565rem + 1.0363vw, 4rem)"
},
{
"name": "2X-Large",
"slug": "80",
"size": "clamp(3.5rem, 2.5259rem + 4.1451vw, 7.5rem)"
}
]
},
"typography": {
"customFontSize": false,
Expand Down Expand Up @@ -316,26 +362,6 @@
"radius": "unset"
}
},
"core/buttons": {
Copy link
Member

@stian-overasen stian-overasen Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that this is horizontal gap between buttons, not vertical block margin.

"spacing": {
"blockGap": "var(--wp--preset--spacing--50)"
}
},
"core/columns": {
"spacing": {
"blockGap": "var(--wp--preset--spacing--50)"
Copy link
Member

@stian-overasen stian-overasen Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is horizontal gap between columns. Not related to the vertical block margins.

}
},
"core/group": {
"spacing": {
"blockGap": "var(--wp--preset--spacing--50)"
}
},
"core/post-template": {
"spacing": {
"blockGap": "var(--wp--preset--spacing--50)"
}
},
"t2/ingress": {
"typography": {
"fontSize": "var(--wp--preset--font-size--medium)",
Expand Down Expand Up @@ -368,12 +394,6 @@
}
},
"caption": {
"spacing": {
"margin": {
"bottom": "0",
"top": "0"
}
},
"typography": {
"fontSize": "var(--wp--preset--font-size--small)"
}
Expand Down Expand Up @@ -403,7 +423,6 @@
}
},
"spacing": {
"blockGap": "var(--wp--preset--spacing--80)",
"padding": {
"left": "1rem",
"right": "1rem"
Expand Down
Loading