Re: author-defined color aliases

* Eric A. Meyer wrote:
>    No, the end user doesn't.  The end user also doesn't need to know 
>that a color has been represented as rgb(50%,20%,80%) instead of 
>#8033CC, so should we get rid of the former?  Of course not.  All of 
>CSS is predicated, to at least a large degree, on developer 
>convenience.  If we wanted to make things harder for developers, we 
>would have just stuck with HTML-based presentation.  Or left out 
>@import and the ability to link stylesheets, so that the CSS had to 
>be embedded in the 'head' of every document.

That's actually kind of a solution as far as XHTML is concerned, try

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  [
    <!ENTITY foreground "rgb(0, 128, 255)">
    <!ENTITY background "rgb(255, 128, 0)">
    <!ENTITY block      "font: small-caps xx-large/3 Georgia, serif;
                         padding: 20px;">
    <!ENTITY smiley     "&#x263A;">
  ]>
  <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <title></title>
      <style type='text/css'>
      p {
        color:            &foreground;;
        background-color: &background;;
        border:           &foreground; thick solid;
      }
      span { &block; }
      </style>
    </head>
    <body>
      <p>Hello <span style='color: &background;
      background-color: &foreground;'>World &smiley;</span>!</p>
    </body>
  </html>

in a browser supporting XHTML and CSS.

Received on Tuesday, 8 July 2003 17:27:33 UTC