----- Original Message ----- From: "Jamie Heilman" <jamie@audible.transient.net> To: "Chris Withers" <lists@simplistix.co.uk> Cc: "Dylan Jay" <me@dylanjay.com>; <zope-dev@zope.org> Sent: Tuesday, March 30, 2004 8:13 PM Subject: Re: [Zope-dev] ZPT for CSS, anyone?
Chris Withers wrote:
Dylan Jay wrote:
disadvantage that the css is no longer valid once templated. ZPT of course would be the solution if CSS was XML, but alas :(
I think ZPT is just fine for generating CSS. It coudl do with a plan text mode, like it has an HTML and XML mode, but apart fro mthat, it rocks :-)
Stylesheets should always be static documents, a dynamic stylesheet defeats browser caching and destroys the advantages over just inlining all the presentation markup. If you want to have dynamic style, you should use dynamic cascading & inclusion instructions, but the stylesheets themselves should remain static. As such, generating style in ZPT is a complete waste of time and effort. The File object is a much better fit.
Actually my use case isn't really for dynamic stylesheets but for absolute urls. I want to be able to edit say a filesystem site using dreamweaver and have relative urls like background-image: url(back.jpg) work, and then when this is used in a zope site such as a plone site then have it use something like background-image: url(http://site.com/back.jpg) to save on repeated requests. The other possible use case might what plone does with dtml in it's skins which is to define a color/font once and use it in many places. I'm not that fussed about that one, but neither of them are really dynamic. What if there was a CSSFile that when loaded changes all urls to absolute urls? That might be too specific but at least it does open the dynamisim flood gates. Dylan Jay --- http://www.meetmemap.com - makes giving directions easy http://www.pretaweb.com - Update-it-yourself, low cost websites http://www.eatmanifesto.com - against all dumbing down of food http://www.idartatravelimages.com/mySearchResults.aspx?query=Virginia%20Choy...