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

Re: [Css Variables] Variable Declaration Blocks

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Wed, 24 Sep 2008 20:57:51 -0700
Message-ID: <48DB0C3F.8020008@terrainformatica.com>
To: fantasai <fantasai.lists@inkedblade.net>
CC: "L. David Baron" <dbaron@dbaron.org>, Mike Wilson <mikewse@hotmail.com>, 'Daniel Glazman' <daniel.glazman@disruptive-innovations.com>, www-style@w3.org

fantasai wrote:
> 
> 
> This was as far as I got Friday afternoon at the F2F:
>   http://fantasai.inkedblade.net/style/specs/constants/
> 
> It's not very complete, but I think it captures the important points
> in the discussion.
> 
> 

fantasai, could you explain the intention of these constructions:

@style name
{
   property: value;
   property: value;
}
@import constants "corporate-colors.css";

?

And what is the purpose of having constants "overridden by a later 
declaration"? (that is from "Scoping of Named Constants" section)

We've found that natural constants first-seen-first-used approach
works just well. For example:

--- main.css ---

@value CORPORATE_BACK #ffeedd url(corp.png) repeat;
@import "module-a.css";
@import "module-b.css";

--- module-a.css ---
@value CORPORATE_BACK red; /* fall back value if it was
                               not defined before */

div { background: @CORPORATE_BACK; }
---

This way module-a.css could work in standalone mode and as an inclusion
in some other main.css.

Motivation of this approach: any style sheet that uses constants
has to declare constants used inside. By assigning fall-back values
designer may e.g. discover missed declarations, etc.

-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Thursday, 25 September 2008 03:58:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:12 GMT