Re: CSS Variables Draft Proposal

Tab Atkins Jr.:
> On Tue, Feb 15, 2011 at 8:07 AM, Christoph Päper
>> How much are you decided on using the abbreviation “var”?
> 
> I'm looking for short and sweet, and easy to use in other contexts.
> Javascript already uses "var" as the word for declaring a variable,
> and it's easy to talk about "CSS Vars" and know that we're talking
> about @var.

JS variables are not the same as CSS variables, though, and JS programmers are not (necessarily) the same people as those writing stylesheets.

>> I am against making variables available across sources (i.e. the trinity of user agent, author and user), except perhaps when explicitly requested to, like this:
>> 
>>  @var $foo bar !important;
> 
> That seems like an odd distinction to make.  Most people, if they want
> to limit the scope of variables, try to limit them to the defining
> sheet and possibly imported/importing sheets.

That’s a subset of the distinction I made. When you import stylesheets you usually have some prior knowledge of their contents. I have no preference re how to deal with variables from imported stylesheets.
If I, on the other hand, use ‘$mycolor’ in my user stylesheet I will probably do so to make its code more maintainable, not to overwrite some random author stylesheet (and vice versa). This is not really comparable to the current situation where you may write a selector (especially with freely definable ID and class names) which accidentally matches, because that depends on the markup, too. I believe this would be confusing.

FWIW I’d have no problem retracting the second, exception part of that statement and therefore say: I am against making variables available across the three types of sources (i.e. user agent, author and user), no exceptions possible.

Received on Tuesday, 15 February 2011 19:38:54 UTC