-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add inherit content size to base styles #42664
Changes from 1 commit
fcfce15
2e9719f
8f219a1
3addf03
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 |
---|---|---|
|
@@ -215,6 +215,20 @@ | |
"margin-left": "auto !important", | ||
"margin-right": "auto !important" | ||
} | ||
}, | ||
{ | ||
"selector": ":where(.has-global-content-size) > :where(:not(.alignleft):not(.alignright):not(.alignfull))", | ||
"rules": { | ||
"max-width": "var(--wp--style--global--content-size)", | ||
"margin-left": "auto !important", | ||
"margin-right": "auto !important" | ||
} | ||
}, | ||
{ | ||
"selector": ":where(.has-global-wide-size) > .alignwide", | ||
"rules": { | ||
"max-width": "var(--wp--style--global--wide-size)" | ||
} | ||
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. I'm wondering if we can use the same classname for these rules, since they have different child selectors. Would it work to have a single 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. Yeah, we should be able to do that. Relatedly, I'm thinking that if there's only one of these sizes set, we should set the other to the same value. We already use this logic in 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. Hmm, can't seem to get fallback values to work for the variables defined in 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. I suspect In the meantime, I made the fallback work by always setting values for both variables to whichever value exists. 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. Nice, always setting both values looks like a good way to handle the fallback for now! |
||
} | ||
], | ||
"spacingStyles": [ | ||
|
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.
For some reason I really like this line removal. To me it makes the whole behaviour in this PR feel like the layout support is a bit more logical and less magical, so it's nice we can remove this! 👍