Block Gap css variable is loaded in the editor for some classic themes #35197
Labels
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
Related: #34452
The generated CSS variable for the block gap spacing config is being added to the stylesheet for some classic themes, only in the editor.
The styling rules that pick it up and utilize it for layout spacing are not generated, but the existence of the global
--wp--style--block-gap
variable at all causes backwards compatibility issues for blocks that opt into the Gap block support or otherwise make use of the variable in their CSS. For example, this kind of styling rule anticipates that--wp--style--block-gap
will be undefined in classic themes, allowing fallback to a default value:Instead, the global 24px gap is picked up in the editor, and the fallback value is picked up on the frontend.
Themes where I can reproduce the bug: Twenty Twenty One, Seedlet
Themes where I cannot reproduce: Twenty Twenty, Maywood
Step-by-step reproduction instructions
--wp--style--block-gap
is defined and is being picked up by this column's styles (so the left margin is 24px)--wp--style--block-gap
is no longer defined, so the fallback2em
is used for the margin.Screenshots, screen recording, code snippet
Styles in the editor:
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: