W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2020

[csswg-drafts] [css-variables-1] Custom properties and serialization (#5685)

From: Kevin Babbitt via GitHub <sysbot+gh@w3.org>
Date: Thu, 29 Oct 2020 22:23:49 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-732704035-1604010228-sysbot+gh@w3.org>
kbabbitt has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-variables-1] Custom properties and serialization ==
The CSSWG [previously resolved](https://logs.csswg.org/irc.w3.org/css/2016-09-19/#e722375) that custom properties must preserve their input exactly for serialization. I've been working on implementing that behavior in Blink, and @andruud brought up some cases in code review that seem worth clarifying:

1. When serializing the computed value of a custom property, is the original text preserved? What about a custom property that has had another custom property substituted into it? Based on the use cases in the discussion, I'd think the answer would be "yes," and this is also what Gecko does.

```
    --y: /* baz */;
    --x: /* foo */ var(--y) /* bar */;
```

2. When serializing a specified value containing a `var()` reference. is the original text preserved? I think the use case of "transport non-CSS text in a custom property" is less compelling here, but Gecko preserves in this case as well.

```
  color: /* bah */ var(--x);
```

3. What about registered custom properties? In the case below, I'd expect that the computed value of `--z` would be ` /* should preserve */` assuming no other rules apply, but I'm not sure whether that would extend to registered custom properties with more restrictive syntaxes:

```
  @property --z {
    syntax: "*";
    inherits: true;
    initial-value: /* should preserve */;
  }
```

Test page for all of these cases: https://jsbin.com/dabegoq/4/edit?html,output

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5685 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 29 October 2020 22:23:51 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:27:17 UTC