NEW 243247
Assign "guaranteed-invalid value (initial)" to css variable from another variable does not work
https://bugs.webkit.org/show_bug.cgi?id=243247
Summary Assign "guaranteed-invalid value (initial)" to css variable from another vari...
Leif Marcus
Reported 2022-07-27 04:34:14 PDT
Created attachment 461241 [details] Example of the implementation In order to implement the so called "Space Toggle" approach, you might create a "--ON: initial;" and a "--OFF: ;" variable inside the ":root" element, in order to reuse it globally. When assigning this value to another variable "--switch-prop: var(--ON)" it will not get the initial value. This works for all other modern browsers, but not in the latest Safari (v15.5). This implementation of the "guaranteed invalid value" is described here: https://www.w3.org/TR/css-variables-1/#guaranteed-invalid. These approach of using this kind of implementations is mentioned in this video: Lea Verou | CSS Variable Secrets | CSS Day 2022 (https://www.youtube.com/watch?v=ZuZizqDF4q8) The expected behavior would be that the "--switch-prop" will be set to initial, if the var "--ON" is assigned.
Attachments
Example of the implementation (97.00 KB, image/png)
2022-07-27 04:34 PDT, Leif Marcus
no flags
Leif Marcus
Comment 1 2022-07-27 04:47:57 PDT
It will actually work, if "--switch-prop: initial" will work as expected.
Radar WebKit Bug Importer
Comment 2 2022-08-03 04:35:16 PDT
Note You need to log in before you can comment on or make changes to this bug.