-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Preset controls need the preset CSS variables in scope #26511
Copy link
Copy link
Closed
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Metadata
Metadata
Assignees
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.
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-wrapperclass), 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.