[wp-trac] [WordPress Trac] #62200: Problem with this writing: var:preset|$feature|$slug
WordPress Trac
noreply at wordpress.org
Thu Oct 10 09:48:15 UTC 2024
#62200: Problem with this writing: var:preset|$feature|$slug
--------------------------+-----------------------------
Reporter: devpeace | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 6.6.2
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Hello,
In this page (https://developer.wordpress.org/themes/global-settings-and-
styles/styles/using-presets/) we can see :
Technically, you can reference presets using the CSS syntax of var( --wp--
preset--{$feature}--{$slug} ). But the WordPress var:preset|$feature|$slug
syntax works much better and always appears correctly throughout the
interface in the WordPress admin. Save the CSS syntax for when you are
actually writing CSS.
However, writing "var:preset|$feature|$slug" works less well than writing
"var( --wp--preset--{$feature}--{$slug} )".
In fact, in theme.json, if you use “var:preset|color|contrast !important”
in “styles.blocks.elements.link.color.text” it won't work.
However, “var(--wp--preset--color--contrast) !important” does work.
Best Regards
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62200>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list