-
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
File block: Add spacing support #45107
Changes from 13 commits
017af05
90d6346
cf727a8
ec8bbe6
6c59b40
39b239d
f4b6ecd
dcf14cd
460905d
fd1d087
137786d
9256bb8
3b55fc6
7035826
b8bb5c2
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 |
---|---|---|
|
@@ -57,6 +57,17 @@ | |
"supports": { | ||
"anchor": true, | ||
"align": true, | ||
"spacing": { | ||
"margin": true, | ||
"padding": true | ||
}, | ||
"__experimentalStyle": { | ||
"spacing": { | ||
"margin": { | ||
"bottom": "1.5em" | ||
} | ||
} | ||
}, | ||
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. Unfortunately, I don't think we can make this switch yet as it would be a regression for themes without a theme.json file due to the generated styles not being loaded for them. See: #46818 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. Thanks for mentioning this, and for linking through to the WIP work to fix layout conflicts with margins. Something that's also relevant here is that in the exploration by @tellthemachines over in #47858 the Columns block's default 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.
There is a specific stylesheet loaded for them now though? The style should be added there. 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. 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. Here is where the classic.scss file was introduced. https://developer.wordpress.org/reference/functions/wp_enqueue_classic_theme_styles/ 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. Thank you for trying out the classic.scss approach @carolinan Unfortunately, I think things have changed a bit recently. #47858 landed which fixed the layout margin rule specificity. Part of that meant lowering the specificity of some blocks' CSS rules. This included the File block. The current state of this PR means we would have the margin rule in 3 places (style.scss, classic.scss, and block.json). I suspect we might be better off removing the addition of the new rule to 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 don't think the layout margin rules are fixed, there are issues with two of the other blocks I have spacing PR's for. 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. The "fixing" of margin rules was so that a block's global styles for margin could be applied. I believe the fix from #47858 is still working. It sounds like the interaction between the overall layout styles and top-level block margins is what you don't think is working correctly? I'm about to start looking more closely at the Preformatted spacing PR. The left/right margins not being applied for top-level blocks makes sense but I need to have a play around with the PR to see what's happening on the frontend. I'll comment further on that PR. 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. Coming back to this one with fresh eyes, I still think we just need to remove the classic.scss style and this 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. Removed 👍 |
||
"color": { | ||
"gradients": true, | ||
"link": true, | ||
|
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.
As noted in the
__experimentalStyle
thread, we'll need to remove this style fromclassic.scss
to maintain the lower specificity default set instyle.scss
required by layout supports.