Re: [csswg-drafts] [css-syntax] Trim whitespace around declarations? (#774)

Note that the change to the custom var grammar means that ``--foo: ;`` results in --foo having its initial value, thus making ``background-image: var(--foo) #gradient`` equivalent to ``background-image: var(--no-such-var) #gradient`` per <a href="https://drafts.csswg.org/css-variables-1/#substitute-a-var">“substitute a var()” rules</a>.

So allowing substituting an empty sequence of tokens requires change to those rules [or perhaps change to the initial value].

Another consideration is that ``--foo: ;`` still violates the core grammar, which entails extra work in both spec and implementations.

However, do we absolutely need to allow custom vars to have an empty value? 'background-image' should be doable using a none layer, and 'transform' can of course be done with an identity transform. It's certainly believable that uses exist; I'm just saying that reverting adding the ‘?’ to custom var grammar is an easy option for now, and might be taken if no-one can for now think of a convincing use.

-- 
GitHub Notification of comment by prjnt
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/774#issuecomment-514997895 using your GitHub account

Received on Thursday, 25 July 2019 10:54:09 UTC