You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
In a non-block theme, add a custom CSS var or --wp--style--gallery-gap-default: 37px;
Add a Gallery and check in the frontend that the gap is set to 37px
Also try and block theme and make sure gap still works as expected
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.
[Block] GalleryAffects the Gallery Block - used to display groups of images[Type] BugAn existing feature does not function as intended
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
