-
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
Block editor: Move margins to theme.scss and common.scss #43813
Conversation
Size Change: +169 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
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.
Can we come up with a more extensive list of edge cases that needs to be tested? |
I think the owl selector will still provide the spacing in the this circumstance. |
Tested with underscores ( |
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.
/** | ||
* Reset user agent styles for figure element margins. | ||
*/ | ||
figure { |
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.
If need be, we could always reduce the specificity of this one via :where(figure)
if it has potential to conflict with themes' provided styles?
Ha! I was 5 minutes late to reviewing this one... ah well, better late than never 😆 |
Thanks @andrewserong |
The margin property is invalid for the table-block.... ;-) looks like a classic copy & paste mishap. packages/block-library/src/table/theme.scss All the best, |
Thanks for the heads-up @PaulSchiretz! I have a fix open here: #45674 |
What?
This is an alternative to #43792
This moves margins from the block.json to theme.scss. This means the load order is preserved in the front and backend.
I have also added a reset to the common.scss file, so that if themes don't want to load opinionated styles they will still get this reset on the figure elements like image and embed.
I'd rather have the margins in theme.scss than style.scss because style.scss should ideally only contain rules that cannot be expressed in theme.json. We could probably get away with only having this rule in common.scss but the specificity will be different, so it's safer to also leave the existing rules in theme.scss as well.
Fixes #43618
Why?
So that the editor matches the frontend.
Testing Instructions