-
Notifications
You must be signed in to change notification settings - Fork 2
Use CSS for spacing #601
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
Use CSS for spacing #601
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| @import "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); | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| @import "./config/_index.css"; | ||
|
|
||
| /* Preferred box-sizing value */ | ||
| *, | ||
| *::before, | ||
|
|
||
| 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"> | ||
| <!-- wp:post-content {"align":"full","layout":{"type":"constrained"}} /--> | ||
| </main> | ||
| <!-- /wp:group --> | ||
| <!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer","className":"footer-wrapper"} /--> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
|
@@ -316,26 +362,6 @@ | |
| "radius": "unset" | ||
| } | ||
| }, | ||
| "core/buttons": { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)", | ||
|
|
@@ -368,12 +394,6 @@ | |
| } | ||
| }, | ||
| "caption": { | ||
| "spacing": { | ||
| "margin": { | ||
| "bottom": "0", | ||
| "top": "0" | ||
| } | ||
| }, | ||
| "typography": { | ||
| "fontSize": "var(--wp--preset--font-size--small)" | ||
| } | ||
|
|
@@ -403,7 +423,6 @@ | |
| } | ||
| }, | ||
| "spacing": { | ||
| "blockGap": "var(--wp--preset--spacing--80)", | ||
| "padding": { | ||
| "left": "1rem", | ||
| "right": "1rem" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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-flowinstead 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 haveis-layout-flowin place.