-
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
Gallery block: Add a backwards compat fallback to 16px for non-block themes #39557
Conversation
Size Change: +55 B (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
Just linking to relevant discussion #38164 (comment) |
const gap = blockGap | ||
? `#block-${ clientId } { --wp--style--unstable-gallery-gap: ${ blockGap } }` | ||
: `#block-${ clientId } { --wp--style--unstable-gallery-gap: var( --wp--style--block-gap, 0.5em ) }`; | ||
: `#block-${ clientId } { --wp--style--unstable-gallery-gap: var( --wp--style--block-gap, ${ gapFallback } ) ${ backwardsCompatGap } }`; |
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.
Should we add some inline comments about the different values and also about backwardsCompatGap
to help our future selves?
I don't know why the following reads better for me. Please ignore. There's no real saving in line numbers or anything useful 😄
const gapFallbackValue = themeSupportsLayout ? '0.5em' : '16px';
const blockGapValue = blockGap || `var( --wp--style--block-gap, ${ gapFallback } )`
const gapCSS = `
#block-${ clientId } {
--wp--style--unstable-gallery-gap: ${ blockGap };
{ ! themeSupportsLayout ? 'gap: 16px;' : '' }
}`;
Just going to put this on the back burner while we decide if we want to add this extra complexity permanently, or just accept the breaking change. |
Just going to close for now - we can come back to it if any issues with the gallery gap in Classic themes |
What?
Adds a backwards compatibility fallback gap of 16px for non-block themes.
Why?
The introduction of gap setting to the Gallery block introduced a breaking change for classic themes of reducing the default gap from 16px to 0.5rem.
How?
Adds a default gap of 16px, but only for classic themes
Testing Instructions