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

CandesTheme $75

Advertise / Sponsors

Post a job. Find one. authenticjobs.com How to Be a Rockstar Freelancer
Comments RSS Feed

Recent Comments

  • Oskar Krawczyk: It’s always nice to hear that someone has joined the right side of the force. Have fun!
  • MichaĆ«l Villar: Hi, Great choice. For the home/end key, it’s cmd + left/right arrows. alt + left/right arrows...
  • Astralis: Here’s the fix for the padding issue. Of course, I don’t know what this fix may have broken,...
  • Astralis: The span padding (I believe) in Safari and Chrome don’t work.
  • i8pikachu: This menu doesn’t look so great using Chrome.