W3C home > Mailing lists > Public > www-style@w3.org > July 2004

RE: pseudoclass based on document content

From: Mark Moore <mark.moore@notlimited.com>
Date: Fri, 16 Jul 2004 16:16:34 -0700
To: <www-style@w3.org>
Message-Id: <20040716231934.76554A0954@frink.w3.org>

Justin,

I really like your regex idea.  With that said, you might generate the
following table entries:

<td class="financial>123</td>
<td class="financial><span class="negative>123</span></td>
<td class="financial>(none)</td>

<!-- /*style sheet frag*/ -->
.negative {
  color: red;
}
.negative:before {
  content: "-(";
}
.negative:after {
  content: ")";
}


This keeps the content and presentation separate.

-MM


> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf
> Of Justin Watt
> Sent: Friday, July 16, 2004 3:10 PM
> To: Andrew Fedoniouk
> Cc: www-style@w3.org
> Subject: Re: pseudoclass based on document content
> 
> 
> 
> That would work...
> 
> ...unless you're already specifying a uniform style for the TDs:
> 
> <td class="financial">123</td>
> <td class="financial">-123</td>
> <td class="financial">(none)</td>
> 
> Assuming the numbers and table are being generated by code, I'd
> could avoid the CLASS conflict this way:
> 
> <td class="financial" STYLE="color:black;">123</td>
> <td class="financial" STYLE="color:red;">-123</td>
> <td class="financial" STYLE="color:black;">(none)</td>
> 
> But then we've just totally blown a hole through the wall separating
> content/programming and style.
> 
> --justin
Received on Friday, 16 July 2004 19:19:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:31 GMT