Re: [Css Variables] Variable Declaration Blocks

On Sat, 18 Oct 2008, Andrew Fedoniouk wrote:

> -- a.css --
> @import url(b.css);
> @import url(c.css);
>
> c.css may arrive first and so to be processed/parsed first. So
> constants in b.css will override the ones in c.css.
>
> Therefore you cannot use constant value in parse time in the
> file where it is declared. So you will get @variables instead of @constants.
>
> It appears as CSS constants in order to be used in parse time
> must obey following rules:
>
> 1) First seen - first used.
>
>   First declaration of the constant establishes its value.
>   Later [re]declarations of the same constant must be ignored.
>
> 2) Scope.
>
>   Scope of constant is the CSS file where it is declared and
>   all its children - CSS files loaded from it by @import
>   statements. New constants declared in child CSS file are not
>   seen in the parent CSS file and so are local to the child
>   CSS file.
>
> All other options lead to @variables as far as I can tell.

if you invent scope, then there is nothing wrong with redeclaration, and 
afaik any _usable_ system allow it, in terms like 'override' and/or 
'conditional set/define'

e.g. in your examle:
b.css:
   define b parametrization constants defaults
   rules
c.css:
   define c parametrization constants defaults
   rules
a.css:
   define parametrization of b
   @import b
   define parametrization of c
   /*???but what should i do if there are conflicting names in b and c?*/
   @import c

>
> Cheers,
>
>

Received on Monday, 20 October 2008 11:48:42 UTC