Invalid real time generated CSS for ref
value when changing font sizes presets in the Global Styles panel (Site Editor)
#59585
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
I tried to add a new block style to my
core/heading
block. The new style is calledtitle
.The idea is to replicate the
h1
element style into thetitle
custom block style.After discussion in #59163, I tried to use the
ref
value and block style variations in thetheme.json
to bind theh1
values into my newtitle
block style.This works well on the front website and block editor.
But when I use the Global Styles panel (Site Editor) to change the H1 style (
Global Styles > Typography > Headings > H1 tab
), there is an issue when using thefontSize
presets control.The real time CSS generated is still in raw value
var:preset|font-size|large
instead ofvar(--wp--preset--font-size--large)
.But after we clicked the
Save
button (top right side), the generated CSS is flushed again and shows the correct value.Step-by-step reproduction instructions
theme.json
file. This will add block style variation fortitle
block style oncore/heading
block.core/heading
block into the template content.Title
block style. The heading block should replicate the H1 style even though the heading block level is not set toh1
.Typography > Headings > H1 tab
.S M L XL XXL
presets.Title
style, because Site Editor JS generate invalid CSS value (see screenshot above).Screenshots, screen recording, code snippet
Snippet 1 (
theme.json
):Environment info
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: