[Webkit-unassigned] [Bug 243247] New: Assign "guaranteed-invalid value (initial)" to css variable from another variable does not work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 27 04:34:14 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=243247

            Bug ID: 243247
           Summary: Assign "guaranteed-invalid value (initial)" to css
                    variable from another variable does not work
           Product: WebKit
           Version: Safari 15
          Hardware: Mac (Apple Silicon)
                OS: macOS 12
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: hello at leifmarcus.com

Created attachment 461241

  --> https://bugs.webkit.org/attachment.cgi?id=461241&action=review

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220727/8afb1c53/attachment.htm>


More information about the webkit-unassigned mailing list