-
Notifications
You must be signed in to change notification settings - Fork 360
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
Quadrat: Add alignments for image cover and video #3816
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
} | ||
|
||
@include break-mobile { | ||
// limit size of any element that is aligned left/right | ||
// limit size of any element that is aligned left/right | ||
.wp-block[data-align="left"], // This is for the editor | ||
.wp-block[data-align="right"], // This is for the editor | ||
.wp-site-blocks .alignleft, | ||
|
@@ -15,9 +15,9 @@ | |
} | ||
|
||
// When content is aligned left/right (particularly inside of a container) it is floated left/right | ||
// and needs something to ensure that the content follows the block rather than nestling up beside the floated element. | ||
// and needs something to ensure that the content follows the block rather than nestling up beside the floated element. | ||
// The issue should be resolved upstream: https://github.com/WordPress/gutenberg/issues/10299 | ||
.wp-block-group:not(.site-header) { | ||
.wp-block-group:not(.site-header) { | ||
overflow: auto; | ||
} | ||
|
||
|
@@ -26,4 +26,19 @@ | |
// class which would do this for us. I'm not sure why but this centers things appropriately. | ||
.aligncenter { | ||
text-align: center; | ||
} | ||
} | ||
|
||
// These blocks go right to the edge of the viewport | ||
.wp-block-image, | ||
.wp-block-cover, | ||
.wp-block-video { | ||
&.alignfull { | ||
margin: 0 calc(-1 * var(--wp--custom--margin--body-horizontal)); | ||
width: calc(100% + var(--wp--custom--margin--body-horizontal)*2); | ||
|
||
@include break-mobile { | ||
margin: 0 calc(-1 * var(--wp--custom--margin--body-horizontal-desktop)); | ||
width: calc(100% + var(--wp--custom--margin--body-horizontal-desktop)*2); | ||
} | ||
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. Redefining variables (as noted below in _body.scss) would eliminate the need for additional breakpoints like this. There would just be one calculation, the value of the variable changing depending on the viewport width. |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import '../base/breakpoints'; | ||
|
||
body { | ||
padding: var(--wp--custom--margin--body-vertical) var(--wp--custom--margin--body-horizontal); | ||
|
||
@include break-mobile { | ||
padding: var(--wp--custom--margin--body-vertical-desktop) var(--wp--custom--margin--body-horizontal-desktop); | ||
} | ||
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. Leveraging and then redefining the variables here would allow for other places that use the body padding variables to do so only once (the value of the variable would change based on the breakpoint)
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
* - Styles for basic HTML elemants | ||
*/ | ||
|
||
@import "body"; | ||
@import "links"; | ||
@import "forms"; | ||
@import "forms"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,6 +129,10 @@ | |
}, | ||
"margin": { | ||
"baseline": "10px", | ||
"bodyHorizontal": "20px", | ||
"bodyVertical": "0px", | ||
"bodyHorizontalDesktop": "35px", | ||
"bodyVerticalDesktop": "0px", | ||
"horizontal": "20px", | ||
"vertical": "30px" | ||
}, | ||
|
@@ -193,8 +197,8 @@ | |
}, | ||
"post-content": { | ||
"padding": { | ||
"left": "var(--wp--custom--margin--horizontal)", | ||
"right": "var(--wp--custom--margin--horizontal)" | ||
"left": "0px", | ||
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. Need to look at the impact of this change |
||
"right": "0px" | ||
} | ||
}, | ||
"pullquote": { | ||
|
@@ -518,4 +522,4 @@ | |
"fontWeight": "300" | ||
} | ||
} | ||
} | ||
} |
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.
I'm concerned that by adding more custom variables within the theme that are media query specific, we are going down a similar path to alignments that won't be compatible with FSE.
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.
Do you think that these variables should be set by the Site Editor?
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.
I rather think they make sense as variables in a theme for re-use, but (IMO) doesn't HAVE to be surfaced to the user (and is unlikely to be a standard way). So they make sense in a child theme, just not BCB. I'm not sure that I'm keen for most of this to be in BCB; it all feels very theme-specific and something unlikely to be handled by gutenberg (thus not something to be handled by BCB).
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.
Since we have a standard method of describing padding perhaps it would be better to define this just like any other element. And to take a note from the button hover state refactor, perhaps could also express the mobile 'state' in the same way. i.e.
It's more verbose but follows the convention of Gutenberg.