[thelist] CSS variables ?

Christian Heilmann codepo8 at gmail.com
Thu Apr 17 17:02:42 CDT 2008


Bojan Tesanovic wrote:
> Hi people,
> Wondering if there is such CSS feature like variables.
>
> What I need is to define 4 colors at the top of CSS and use those  
> through out CSS.
> Here is example
>
> $color1 = darkblue;
> $color2 = blue;
> $color3 = silver;
> $color4 = lightblue;
>
> h1{color: $color1}
> .mystle{color: $color3}
> .container {color: $color1; background-color: $color4;  border: 2px  
> solid $color3 }
>
> etc
>
>
> so I can easily change top colors until I get nice color combination  
> for site.
> If there is some other way I am happy to listen.
>   
There is no native way but I did some pre-processors:
http://icant.co.uk/articles/cssconstants/




More information about the thelist mailing list