WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
285370
CSS custom property with revert-layer treats var() reference as string
https://bugs.webkit.org/show_bug.cgi?id=285370
Summary
CSS custom property with revert-layer treats var() reference as string
Shaw Jia
Reported
2025-01-03 16:15:14 PST
I understand that currently, only registered, inheriting custom property can use revert-layer keyword:
https://wpt.fyi/results/css/css-variables/variable-css-wide-keywords.html?label=master&label=experimental&aligned
That being said, I found that when I do try to use it for a registered, inheriting custom property, it will treat any value that is a var() reference as plain string. For the following CSS, we expect the body text color to be red, but Safari renders it as black because revert-layer causes it to treat “ --color: var(--var);” as a plain string assignment rather a variable reference. body { @layer { --var:red; --color: var(--var); } @layer { --color:revert-layer; } color:var(--color); } @property --color { syntax:"*"; inherits:true; } Codepen example:
https://codepen.io/Miragecraft/pen/gbYXGGW
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2025-01-10 16:16:14 PST
<
rdar://problem/142715068
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug