NEW241475
Allow keywords in CSS custom property fallback
https://bugs.webkit.org/show_bug.cgi?id=241475
Summary Allow keywords in CSS custom property fallback
Shaw Jia
Reported 2022-06-09 10:43:49 PDT
Allow the use of keywords in custom property fallback. One useful use case is to allow the use of "revert" to use user-agent stylesheet value as fallback. Ex: * {display:var(--display,revert); --display:initial} The example may seem redundant, but becomes useful with more complex logic such as responsive variants, modular scale for font sizes etc. Firefox already supports this, Chrome is in the process of fixing it in https://bugs.chromium.org/p/chromium/issues/detail?id=1105782
Attachments
Radar WebKit Bug Importer
Comment 1 2022-06-10 10:08:02 PDT
Shaw Jia
Comment 2 2024-10-07 21:29:32 PDT
Any updates to this? Safari is now the only browser that doesn't support keywords in CSS variable (custom property) fallback. Both Chrome and Firefox supports it.
Christopher Kirk-Nielsen
Comment 3 2024-12-14 08:04:16 PST
I believe I have run into the same issue and I'm seeing the correct styles in Chrome and Firefox, but not Safari. I have a reduced test case here which is manifested when toggling Dark Mode: https://codepen.io/chriskirknielsen/pen/emOBrvZ?editors=1100 Happy to create a new ticket if I'm incorrect about this being the same bug.
Note You need to log in before you can comment on or make changes to this bug.