You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by JavaJosh <jo...@yahoo.com> on 2002/03/11 20:53:20 UTC

Can I "precompile" CSS?

Hi,

I would like to precompile my HTML files that have style sheets. That
is, I would like to generate (perhaps on the fly) basic HTML markup from
the CSS. For example, I want to turn:

P.main {font-family : sans-serif; font-size : 12pt}
...
<p class="main">This is a paragraph</p>

into

<p> <font face="Arial" size="7"> This is a paragraph </font></p>

I would prefer to avoid such behavior, as many CSS attributes cannot be
mapped to basic (HTML32) tags. However, I can see where this would be
useful for users of older browsers that don't understand CSS.

(A secondary consideration is the protection of CSS content. This isn't
something that concerns *me* but I can see where it might be an issue.)

So is there a way to do this, if not with a Tomcat directive, with a
special servlet or library?

Thanks,
Josh Rehman


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Can I "precompile" CSS?

Posted by Ken Martin <ke...@digitalcyclone.com>.
On Monday, March 11, 2002, at 01:53 PM, JavaJosh wrote:

> I would like to precompile my HTML files that have style sheets. That
> is, I would like to generate (perhaps on the fly) basic HTML 
> markup from
> the CSS. For example, I want to turn:
>
> P.main {font-family : sans-serif; font-size : 12pt}
> ...
> <p class="main">This is a paragraph</p>
>
> into
>
> <p> <font face="Arial" size="7"> This is a paragraph </font></p>
>
> I would prefer to avoid such behavior, as many CSS attributes cannot be
> mapped to basic (HTML32) tags. However, I can see where this would be
> useful for users of older browsers that don't understand CSS.
>
> (A secondary consideration is the protection of CSS content. This isn't
> something that concerns *me* but I can see where it might be an issue.)
>
> So is there a way to do this, if not with a Tomcat directive, with a
> special servlet or library?

I'm sure there would be a way to do this, but it seems like a 
*lot* of work for questionable payoff (and sounds slow). Do your 
browser stats really indicate that you need to put so much 
effort toward making HTML 3.2 code? In our site which is 
non-technical (a weather site) we only use CSS for text 
formatting and various colorings... we have a very wide range of 
users and I do not get complaints. Virtually all used browsers 
can handle CSS for fonts... CSS-P gets much more glitchy.

Personally, if I *had* to do this I would consider using XML and 
apply XSL dynamically based on browser sniffing. But in the end 
I would have a very hard time justifying the effort.

Use CSS to define elements, and use few classes and spans and 
you should be able to be quite compatible.

JTOTTOMH, you could probably write (fairly complex) taglibs for 
this... blech.

Ken Martin


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>