W3C home > Mailing lists > Public > www-style@w3.org > April 2012

Re: [css-variables] Adding a default value to var()

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 2 Apr 2012 22:33:08 -0700
Message-ID: <CAAWBYDA5afLLPkT7vWmHixp_sSX=JJHeZDeifixqi5AVgTWKmA@mail.gmail.com>
To: Chris Eppstein <chris@eppsteins.net>
Cc: www-style list <www-style@w3.org>
On Mon, Apr 2, 2012 at 8:24 PM, Chris Eppstein <chris@eppsteins.net> wrote:
> We have default values for variables in Sass, but I do not think they are
> necessary in CSS variables because the value is resolved after the cascade
> is applied. As such, you can set the value to the default value and the
> consumer of the "themeable" stylesheet can always override that value if
> they choose to in their own stylesheets.

The problem with that is that they need to ensure that their rule wins
in the cascade, which isn't always trivial.  In some cases, such as
Web Components, it may even be impossible, since you can't target
selectors into the component (it's intended that inheritance will
transfer variables from the component's root into the shadow tree,
where they can be used in styles).

That's also not an option if we try to merge Variables and SVG
parameters, since the "provider" of the explicit variable values isn't
using a stylesheet to do it at all.

~TJ
Received on Tuesday, 3 April 2012 05:33:56 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:52 GMT