The Artima Developer Community
Sponsored Link

Web Buzz Forum
A feature request for CSS3

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Simon Willison

Posts: 282
Nickname: simonw
Registered: Jun, 2003

Simon Willison is a web technology enthusiast studying for a Computer Science degree at Bath Uni, UK
A feature request for CSS3 Posted: Jul 22, 2003 10:40 AM
Reply to this message Reply

This post originated from an RSS feed registered with Web Buzz by Simon Willison.
Original Post: A feature request for CSS3
Feed Title: Simon Willison: [X]HTML and CSS
Feed URL: http://simon.incutio.com/syndicate/markup/rss1.0
Feed Description: Simon Willison's [X]HTML and CSS cateory
Latest Web Buzz Posts
Latest Web Buzz Posts by Simon Willison
Latest Posts From Simon Willison: [X]HTML and CSS

Advertisement

One of the niggles I have with CSS 2 is that I frequently have to define colours multiple times. Consider this blog: I use orange in several places (as a background to the header, a border around the sidebar and a background to the sidebar h3 elements). Should I decide to change the shade of orange, or change it to another colour, I would have to alter my stylesheet in several places.

A nice addition for CSS 3 would be the ability to define "constants" for colours (and maybe for other types as well, although I can't think of any that need them off the top of my head). It would be extremely convenient to define a bunch of colour constants at the top of a stylesheet and then refer to them elsewhere. For example:


@define {
  colour_1: orange;
  colour_2: navy;
  colour_3: #f00;
}

/* later in the stylesheet ... */

h3 {
  background-color: &colour_1;
}

That way, changing the @define block at the top of the sheet would change the colour of any element referring to a constant. I'm sure there are much better alternatives for the syntax, but the above should at least make the concept clear.

Read: A feature request for CSS3

Topic: CSS Headings Previous Topic   Next Topic Topic: position:fixed in IE, no Javascript required

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use