Gallery block: Add a backwards compat fallback to 16px for non-block themes#39557
Closed
glendaviesnz wants to merge 1 commit into
Closed
Gallery block: Add a backwards compat fallback to 16px for non-block themes#39557glendaviesnz wants to merge 1 commit into
glendaviesnz wants to merge 1 commit into
Conversation
|
Size Change: +55 B (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
Member
|
Just linking to relevant discussion #38164 (comment) |
ramonjd
reviewed
Mar 17, 2022
| 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 } }`; |
Member
There was a problem hiding this comment.
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;' : '' }
}`;
Contributor
Author
|
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. |
Contributor
Author
|
Just going to close for now - we can come back to it if any issues with the gallery gap in Classic themes |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
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