Re: [css-variables] ...let's change the syntax

* Tab Atkins Jr. wrote:
>Simultaneously, I'm wrestling with the fact that basically nobody
>understands that one of the primary use-cases of Custom Properties is
>to do CSS polyfills, where you write your own properties with a "var-"
>prefix and interpret them with JS.  This avoids the "have to re-parse
>the whole stylesheet yourself, and woe unto you if it's cross-origin"
>problem that today's CSS polyfills have.  From what I can tell, it's
>the "var-" prefix that's misleading everyone - it's *so* closely tied
>to var(), mentally, that it prevents people from imagining any other

I do not think it is the tie to `var()`, but simply the name that says
"variable" and not "custom property". And probably historical baggage.
Thinking about it, I am not actually sure off hand why we call custom
properties also "variables".

>So, suggestion.  Assuming that we're sticking with the underscore
>thing for custom MQs/pseudo-classes/etc, I think we should move the
>syntax of Custom Properties to "any ident starting with/containing an
>underscore" as well.  This'll tie the syntax more closely to the
>*other* "custom" things, which hopefully will lead to it being more
>obvious that this is literally a CUSTOM PROPERTY, not just a variable

It is hard to visually distinguish hyphens and underscores, and if no
other indicator than the underscore is required then it becomes hard
to mentally map the names correctly without the visual aid. I don't
think underscores and hyphens should be mixed in names like that.
Björn Höhrmann · ·
Am Badedeich 7 · Telefon: +49(0)160/4415681 ·
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · 

Received on Thursday, 13 March 2014 22:12:09 UTC