Preset controls need the preset CSS variables in scope #26511
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
Reported at https://github.com/Automattic/themes/pull/2659/files#r512186187
Theme authors can use CSS Custom Properties to define the presets, for example, to make the gradients depend on the solid colors:
These definitions end up attached to the user-facing UI tools. The problem is that these tools aren't part of the editor canvas (wrapper by the
.editor-styles-wrapper
class), so the CSS Custom Properties aren't defined, hence it doesn't work. See what would happen in this case:This is because, both in the post-editor and the site-editor, the global styles are prefixed by the editor wrapper, hence its scope doesn't reach the UI controls.
The text was updated successfully, but these errors were encountered: