[kwlug-disc] CSS: varying colours based on inheritance

Andrew Sullivan Cant acant at alumni.uwaterloo.ca
Thu Jul 7 10:25:40 EDT 2011


Paul,

SASS (which is a CSS like language which compiles into CSS, might be 
helpful)
http://sass-lang.com/docs.html

It lets you set variables, and then do various extra operations. Such as 
operations on colours.
http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#color_operations

This is big in the Ruby/Rails community, but it is being used in other 
frameworks, too.
You can also compile it manually, or whatever framework you are working 
with might already support it.

Andrew


On 11-07-06 9:45 PM, Paul Nijjar wrote:
>
>
> Right. That is what I would consider setting colours individually at each level.
>
> I can set opacity at different levels:
>
> ul { color: #00ff00; }
>
>
> ul ul {
>   filter:alpha(opacity=80); /* ie */
>   opacity:0.8;  /* CSS3 */
> }
>
> ul ul ul {
>   filter:alpha(opacity=60); /* ie */
>   opacity:0.6;  /* CSS3 */
> }
>
>
> But I don't know how to set colours programmatically, and I do not know how to
> make this nest to arbitary depth without stating levels explicitly.
>
> It turns out that trying to do this programatically might be a bad idea because
> I need more contrast from ul to ul. It still seems weird that CSS can't do this.
> (That last sentence has never been uttered in the history of the Internet.
> Ever.)
>
>
> - Paul
>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org




More information about the kwlug-disc mailing list