Dave,
I see what you're saying. I thought you were specifically referring only to the image issue.
What your considering is conditional CSS, which yes, is a bit different.
You might consider maybe the simplest approach by having one stylesheet with all the common stuff that is not variable, and conditionally include the other stylesheets based on your criteria.
In my case, I did that (briefly, until I worked out the issue) to include one stylesheed for MSIE, and another for Firefox/Mozilla.
Regards, tappapp
David Leangen wrote:
Hi, Random Tapestry User, or tappapp, whichever you prefer...
It would be nice to be able to dynamically generate CSS. Is
there a (simple) way this could be done?
Ideally, you probably have an "images" directory that is probably a
peer directory to your "css" directory.
Sorry that my question was not so clear.
You gave the example :
.titleGradient { text-align: top; background: url(../images/title-gradient.gif) 0px 0px repeat-y; }
But what if I want "text-align: top" in one case, but "text-align: bottom" in another?
Now, I know very well I could have two classes, like "titleGradientTop" and "titleGradientBottom", and set the class being used dynamically. The problem with this is that it clutters up the CSS. If you think about all the possible combinations of styles, it's just not practical. It just seems so much elegant and useful to be able to generate the CSS dynamically.
It would be very useful to be able to do something like:
public void setTitleGradientCssClass(final Object testParam) {
if ( testParam.isSomeTestTrue ) { getCss().getText().setAlign(TOP); | else { getCss().getText().setAlign(BOTTOM); }
}
Cheers, Dave
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]