Use styles.color.background
and styles.color.text
as variables
#43627
Labels
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
In theme.json, we can currently set
styles.color.background
andstyles.color.text
, but I believe these are only used by default to setbackground-color
andcolor
inline styles for the body and certain blocks, and they're not made available as variables.What is your proposed solution?
It would be great if these two settings were also assigned to CSS variables that could then be referenced in many more places, such as block markup. Perhaps something like
var(--wp--preset--styles--color--background)
andvar(--wp--preset--styles--color--text)
.We can already do something similar within theme.json using
ref
:The text was updated successfully, but these errors were encountered: