-
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
Lower the priority of the gallery gap css so it loads after the block layout css #41423
Conversation
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.
Good idea @glendaviesnz, this looks like a simple way to fix the issue in the short-term to me!
✅ The gallery block spacing feature still appears to work correctly in the post and site editors with a block theme.
✅ In a classic theme, adding in a rule like :root { --wp--style--gallery-gap-default: 46px; }
in the frontend and editor CSS allowed for overriding the gallery gap's default 0.5em
on the site frontend and within the editor.
Before | After |
---|---|
LGTM!
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.
What @andrewserong said 😄
Tested in block/classic themes the latter by adding --wp--style--gallery-gap-default
+ value to the :root
selector in frontend and editor stylesheets.
Tested on 2021, 2020 and 2022 WordPress themes.
… layout css (#41423) Co-authored-by: Glen Davies <glen.davies@a8c.com>
I just cherry-picked this PR to the wp/6.0 branch to get it included in the next release: 10f347a |
… layout css (#41423) Co-authored-by: Glen Davies <glen.davies@a8c.com>
@glendaviesnz this PR contains PHP changes that need a matching PR in the https://github.com/WordPress/wordpress-develop repository to be included in WordPress 6.0.1. Would you please create such a PR? CC @SergeyBiryukov |
@adamziel WordPress/wordpress-develop#2839 - I assume we branch of 6.0 for this, but let me know if this was the wrong assumption and I will redo the PR |
@glendaviesnz I just commented on the other PR, we're good! |
What?
Fixes the order that the Gallery gap CSS is enqueued so it is not overwritten by layout CSS in non block themes
Why?
Currently for non-block themes the Gallery block gap CSS is being loading prior to the layout CSS, so the gap value is overwritten by the default 0.5em value
How?
Set the action priority lower in the Gallery render method. This issue is also fixed by #41015, but this smaller change may be easier to backport to 6.0.1?
Testing Instructions
--wp--style--gallery-gap-default: 37px;
37px
Screenshots
Before:
After: