RE: pseudoclass based on document content

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 UTC