Variables in CSS?

Posted on July 1st, 2008, by Cristian in Xhtml & CSS

How long have you wanted to name colors and such in your CSS instead of having to use search and replace (which breaks if you share the same colors ?

Thanks to Daniel Glazman and David Hyatt we have a proposal .

@variables { CorporateLogoBGColor: #fe8d12; }

div.logoContainer { background-color: var(CorporateLogoBGColor ); }

I expect CSS Variables to receive a very positive feedback from community and browser vendors and get implemented in all browsers!

WebKit now has an experimental implementation of CSS variables : You can test this feature using a WebKit nightly.

2 comments

  1. » Variables in CSS? on July 1st, 2008 at 10:07 am
  2. Theo on July 8th, 2008 at 10:30 pm

Leave a comment

Advertise / Sponsors

Comments RSS Feed

Recent Comments

  • yuci: ok, i solved the problem, but i will search for a better one. i just noticed, hidden div doesnt show itself...
  • yuci: hey, yeah i downloaded well, and i edited a lot this application, and i can say that, it is a wonderful app....
  • Cristian: No, it’s working as I tested.
  • yuci: is link dead, or just some temporary problem? i cant download zip files.
  • Fredrik: I can’t get this to work. It seems to fail at $order->setShippingAmount( $shipping_amount +...