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

On Thursday, March 13, 2014, Bjoern Hoehrmann <derhoermi@gmx.net> wrote:

> * Tab Atkins Jr. wrote:
> >On Thu, Mar 13, 2014 at 5:57 PM, Zack Weinberg <zackw@panix.com<javascript:;>>
> wrote:
> >>>> Is my suggestion of
> >>>> "--" everywhere for custom as opposed to "_" just as doable?
> >>>
> >>> Yes, this is just another syntax possibility for custom property
> >>> names, which is exactly what I'm asking about.  Totally possible.
> >>
> >> Unfortunately, "--" would require a change to Syntax. IDENT isn't
> allowed to
> >> start with two dashes in a row.
> >
> >Whoops, you're right.  Forgot about that detail.  Well, -- is ruled out
> then.
>
> That seems an odd position considering how often the Working Group has
> changed details of the core syntax over the years. Unless I am missing
> something, either way the declaration and only the declaration would be
> dropped, so there is no backwards-compatibility concern. And using the
> "--" as infix only would seem preferable over using it as prefix any-
> way. I do not think "--" is much better than the underscore, but I do
> think the question above deserves a better answer than simply pointing
> to the Syntax specification without elaboration.
>

I have to say that as a matter of abstract design, "--" does seem
marginally better than an underscore, and as an implementer, I would not
miss the special case logic needed to accept -foo and -f-oo but not --foo
as IDENTs (for Gecko, see
http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSScanner.cpp#165
and
its uses). But if changing Syntax is on the table, I would also worry about
whether value or selector syntax might (now or in the future) in some
contexts depend on --foo being understood as - -foo. I don't have
those memorized the way I do the core lexer.

zw

Received on Friday, 14 March 2014 03:20:47 UTC