- From: François REMY <francois.remy.dev@outlook.com>
- Date: Tue, 18 Mar 2014 15:30:11 +0100
- To: "Tab Atkins Jr." <jackalmage@gmail.com>, "Daniel Glazman" <daniel.glazman@disruptive-innovations.com>
- Cc: "www-style list" <www-style@w3.org>
> To be honest, I don't think that's what framework authors or even web
> site designers were looking for. They were looking for -jquery-foo and
> -mywebsite-foo because prefixes are already well known. They don't
> care and don't want to care about our syntactic rules about idents
> starting with a hyphen or not. This has always had my preference; users
> first.
Well, now that user preferences is introduced into the thread, I guess it's
a good time to recall I did some research for prior arts on "CSS Custom
Properties" on Google back in 2012 when I wanted to find a prefix that could
ditch "var" after the "x" prefix had been ruled out (objection from Sylvain
about http-headers && conflict with the "x" property of SVG) and discovered
7 prior arts, ranging from questions in forums to flex implementation of
css. 3 of them started properties using a dash "-" (like Daniel points out)
and 3 of them where using "my" as a prefix (one did both), which is why this
prefix got introduced in first place. Another prefix I disovered at the time
was "custom". I think the full list should be somewhere close to [0].
Otherwhise I can try to find it in my own archives if needed.
I believe the "--" proposal is the closest thing to the first half of the
cases ("-" used as prefix would clash with vendor prefixes) while "my-" is
the one the second case seems to be hinting at.
That is :
{
--: initial;
--bg-color: red;
--angular-binding-hint: no-update;
background: var(--bg-color);
}
and
{
my: initial;
my-bg-color: red;
my-angular-binding-hint: no-update;
background: get(my-bg-color);
}
I would already be happy if the working group could resolve on "--" because
this is much better than "var-". That being said, I can hear from here the
people complaining that it requires changing the CSS Syntax, which just got
CR very recently and would revert back to LC, then people arguing we should
not make so huge changes to close-to-cr specs like [css-variables] (because
we do that too often, you know) and I can envision there's then a chance the
WG would resolve to noop because "too big change". I hope this will not
happen.
That being said, if it was to happen, I think we should seriously consider
the "my-" prefix option, which is a much lighter change. At some point,
"my-" could have been the prefix in the spec if Tab didn't simply refuse to
move away from "var-". I made a proposal with usage numbers to back it,
fantasai publicly showed support during a CSS WG meeting [1], other people
showed support [2], and while Brian was not a huge fan, he accepted we used
"my-" in our own CSS Custom Properties draft [3] before we moved to "$" when
Tab switched to "let's not use anything else than $" [4].
If at that time the "CSS Variables are a new kind of variables" thread
urging for a naming+syntax that would not mislead people into assimilating
CSS and SASS/LESS variables (but invite them to discover similarities and
differences) had been read by Tab Today instead of Tab Then, things would
have been quite different, I'm sure.
[0] http://lists.w3.org/Archives/Public/www-style/2012Sep/0142.html
[1] http://lists.w3.org/Archives/Public/www-style/2013Feb/0392.html
|* fantasai has to say, kindof leaning towards' François' suggestion
| to use my- instead of var- ... and also my() instead of var()
[2] http://lists.w3.org/Archives/Public/www-style/2013Apr/0352.html
|At the risk of annoying Tab again (sorry)... might names like my- or
|user- or private- emphasize the user-defined/custom aspect over the
|mechanism by which they are retrieved?
[3]
https://github.com/bkardell/CSS-Custom-Properties-Module-Draft/blob/d80328e1dbb487a5eae0c5715a772fed681d09ac/draft.html#L267
|:root { my-length: 20px; }
|p { background-color: $my-length; }
[4] http://lists.w3.org/Archives/Public/www-style/2012Aug/0471.html
|The decision to rollback the $foo syntax must not come with a
|decision not to consider any new option, certainly given the fact
|that alternatives that were not using the “$” symbol were declared
|“out” at some point.
Received on Tuesday, 18 March 2014 14:30:39 UTC