Re: [Css Variables] Variable Declaration Blocks

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 UTC