-
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
Mayland Blocks: Add support for spacing overrides #3456
Conversation
Adding a custom variable for vertical spacing that can be used in style.css.
Add spacing overrides so that we can set margin/padding to half-width/height, or remove it completely.
One thing I noticed but wasn't sure how to fix was the default top/bottom block margin (without any classes), which is 20px. I would love to bump it up to 32px. |
I feel uncomfortable introducing these classes to a block based theme. If we need this kind of control then I think it should made available to users in the UI, but I'm curious what others think. cc @jasmussen |
Yeah this is a tough one. In my own unreleased experimental theme, I've created a few "helper classes" like these myself, classes that I apply to blocks to have them do my bidding, in absence of the block editor itself supporting them. The good news is, nearly all of them I've been able to retire as the global styles project keeps gaining in features. And ultimately I would agree with Ben, these all seem like classes that exist to be absorbed by the global styles project, so they are user configurable. The thing is, they will land there, hopefully sooner rather than later, I recall @youknowriad mentioning it just last week. And when they do, people will be confused in the cases where it doesn't work, because the Is there a way to solve it that is less reliant on these "utility" helper classes? I know TT1 did some super opinionated stuff with style variations that might be a holdover? |
To give some background, we're putting a few header patterns in preparation for full site editing, and manipulating the vertical space is essential with things like the visual grouping of elements (for example, site title and tagline): To Joen's idea, I saw this kind of thing in Eksell theme, where a few blocks offer a "No Vertical Margin" style. Seeing it in action, I'm not sure this is the right way to go. It really feels like something that should be handled via block setting (which brings us back to Ben's point). I agree that having this handled in core would be ideal. If adding these classes would later interfere with settings, then it's a solid reason no to proceed with this PR. |
While we could technically build in some theme-specific overrides to address this, those sorts of spacing changes should be the same across all themes. Frankly, the lack of consistent margin + padding controls is one of the most glaring issues when trying to build block-based themes (or block patterns for that matter). This Gutenberg issue would address the issue, so I recommend we put our effort towards getting this one closed instead: WordPress/gutenberg#28356 |
Agreed, closing, and let's focus on the core issue instead. |
Changes proposed in this Pull Request:
Mayland and other Varia child themes have a few classes built-in that help to control the spacing. This PR introduces the same spacing override classes to Mayland Blocks.
Related issue(s):
Addresses #3424
Testing:
margin-top-none
,margin-bottom-none
,margin-top-half
, etc.