-
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
Regression: Columns CSS affects readability in WP 6.0 #40952
Comments
I have confirmed. This was introduced a long time ago in Gutenberg: #37436. If a theme supports |
Hi! Just to add some context. #37436 was a necessary step to avoid bugs associated with #37360 (Avoid using CSS variables for block gap styles). #37360 removed the use of
This doesn't do much to help classic themes. The obvious approach is to bump Perhaps our best bet here is to fix a long-standing bug that prevents us from defining blockGap at the block-level. It's something that was needed to be fixed after #37360. Various people have been trying different ways of achieving it. So right now, for block themes, this theme.json style doesn't do anything: "styles": {
"blocks": {
"core/column": {
"spacing": {
"blockGap": "2em"
}
}
}
} Once we get that working, I think the general approach would be to define a default blockGap value for the Columns block (let's set it back to As for classic themes, I'm not sure yet. This PR: allowed presets to be printed out in the source for classic themes. But In the meantime, we could restore the default in the theme style sheets (for every one over in the themes directory)
That is something we could do straight away. What do folks think? cc @aaronrobertshaw and @andrewserong who helped write this comment |
Thanks for the context @ramonjd. I think the easiest and quickest fix is to implement the CSS change that you mentioned. Plus those themes already have massive stylesheets. However, I just tested with Twenty Twenty One and simply using the class
|
Thanks for testing that out @ndiego ! 🙇 I feared we'd have to get specific 😄 but it looks like a pretty safe change here. I'll add to/test with the other themes over at https://github.com/WordPress/wordpress-develop and if it seems to be kosher will reopen the trac ticket WP#55703 |
I'm not overly keen on modifying the default themes as a solution to this. It still leaves the regression for the majority of sites, those that are using custom themes. |
All good. I'm looking at an alternative. Since the change in #34439, there has been a fallback value for the
But there is no corresponding default Rather we've opted to hardcode Why don't we:
I think points 1 and 2 should be done anyway. For example:
[...swap And, in columns/styles.scss and editor.scss: .wp-block-columns {
...
/* The Columns block should have a default block gap of 2em. */
--wp--style--block-gap: 2em; I'm still testing, but it seems to work fine. |
If we do that change, would that then set the fallback for all children of the Columns block to |
That's the catch. Getting around inheritance. Looking at it now, but looks pretty glum. |
I haven't found a reasonable way around this yet. The conundrum appears to be that we can set a default So To make things more fun, in the editor we bump up the specificity: This is actually desirable to avoid inheritance, say, for when a child block of columns sets its own gap value. But it's a hindrance for blocks wishing to set their own low-level specificity gap value. Conclusion: The layout implementation needs to be aware of a specific block's fallback value, if any. Right now a bug prevents us from doing that in block themes, and it wouldn't work for classic themes anyway. The only thing I've found I can count on is that classic blocks do not have access to I see the following potential options (I'm listing everything I've considered regardless of how silly it might sound, but it's in vague order of reasonableness, that is, from reasonable to absolutely fruity):
Point 1 seems like the most promising so far. |
@peterwilsoncc Do you see any problems with updating the core styles anyway? Fishing for more ideas, but I'm not seeing a universal, stable and/or non-hacky fix for this particular regression otherwise until we work out how to get those pesky block-level blockGap styles to work. Edit: Or there's this 3-line hack in layout.php if ( ! $gap_value && ! WP_Theme_JSON_Resolver_Gutenberg::theme_has_support() && 'core/columns' === $block['blockName'] ) {
$gap_value = '2em';
$has_block_gap_support = true;
} |
After chatting with @ramonjd, I've put together a potential fix for the gap issue in #41098 if folks would like to have a look / add any feedback. The idea here is to:
It seems to work so far in the very minimal testing I've done. Happy for any feedback, or to shelve it if anyone comes up with a better solution. At the very least, it seems like it didn't require many lines of code to get working 🙂 |
I'll take a look at this tomorrow, but I suspect it be just as finicky. Looking at the change PR comments we debated the removal of the tablet-styles. If we'd done nothing they would have been broken anyway:
It's a hard one to balance. The changes were trying to make the layout system more consistent overall, but there's an element of relying on themes to update their CSS overrides to accommodate. cc some of the folks that were involved @jasmussen @scruffian @youknowriad in case they have some thoughts 🙇 |
A possible way to apply the 50% rule without knowing the gap is to switch the columns display to
|
This issue is another good argument for the standardized spacing scale proposed in #38998: The default value for the space between columns should be much larger than the default value for space between paragraphs. A single "gap" value was never going to be enough. |
I've tried to reinstate this, and it works to a certain extent but not perfectly. I thought I'd throw it up anyway: As mentioned in the PR
This only affects block themes as far as I can tell. Classic themes with no theme.json that switching on blockGap are fine. |
It's a little close to the release so I'd prefer not too but if it's unavoidable then it can be done. Would it need to be for all bundled themes (2010 - 2022) or a subset only? Sorry, I forgot to answer this earlier today. |
All bundled themes :( I think our time is better spent trying to kick #41098 over the line then. Thanks! |
It should be fixed with #41098. I will prepare all the necessary changes to bring that to WordPress core for 6.0 RC4. |
#41098 fixes the gap issue, but there's still the issue with the columns stacking. |
Description
This was reported on WordPress trac by the WordPress.org user marctison75. The original ticket was WP#55703.
The first part of the issue with the narrow gap seems more important to my mind.
Step-by-step reproduction instructions
Non provided in the original ticket but I'm guessing
Screenshots, screen recording, code snippet
See above.
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: