W3C home > Mailing lists > Public > www-style@w3.org > September 2008

RE: [Css Variables] Variable Declaration Blocks

From: Mike Wilson <mikewse@hotmail.com>
Date: Sun, 28 Sep 2008 22:20:50 +0200
Message-ID: <BAY116-DAV4A70179F217C94AACFC68A4410@phx.gbl>
To: "'Brad Kemper'" <brkemper.comcast@gmail.com>
Cc: <www-style@w3.org>
Message-ID: <039501c921a7$b2fd75a0$0a01a8c0@mikedeskxp>

Brad Kemper wrote:
> Mike Wilson wrote:
> > We already have !important for explicitly pointing
> > out a certain rule to have precedence.
> Not the same thing.

Sorry, I wasn't clear to what I was referring to here. It was
this part that you suggested in your previous mail:

> > Brad Kemper wrote:
> > > But if the author wanted it to act as a constant,
> > > where "first rule overrides later rules", he
> > > could add a keyword to that rule that would
> > > accomplish that by adding 1,000,000 to the
> > > specificity calculation:
> > >
> > > @define constant {
> > > ...

Having the keyword "constant" add a certain number to the
specificity calculation only make those rules win over rules
without the keyword, and doesn't implement the "first rule
overrides later rules" algorithm. Thus, if you have two rules 
with the same "constant" selector the latter will win
according to the cascade.

That's why your suggestion is similar to what is already 
implemented by !important. I understand that what you really 
wanted was to have "first rule overrides later rules" but then 
you will have to either invent position-dependent specificity 
or change the cascade algorithm, not just let a keyword add
a number to the spec calc.

Best regards
Mike Wilson
Received on Sunday, 28 September 2008 20:21:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:39 UTC