The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Declaring Color Values in CSS

  • # June 20, 2008 at 9:01 am

    Is there a way to Declare a color value at the beginning of my CSS file in a variable and then use that variable name when a color is called for in the code.

    # June 20, 2008 at 9:04 am

    Not with pure CSS. You can, however, create your own color-classes since elements can have tons of classes at once (but only one ID, since it’s unique).

    # June 20, 2008 at 10:48 am

    This reply has been reported for inappropriate content.

    The final spec for CSS3 might make this possible, but not yet.

    Couple of ways to handle it though:’ … rs-in-css/

    # June 20, 2008 at 11:36 am

    The Search and replace method is what I have used in the past but I figured there must be a more professional way of doing it.

    Chris, I swear I will remember this time to define the colors in a comments block like you suggested.

    Have a nice weekend.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed