[Zope] Re: best practice, CSS Stylesheets

Tonico Strasser contact_tonico at yahoo.de
Tue Mar 21 08:19:18 EST 2006


Tino Wildenhain schrieb:
> Peter Bengtsson schrieb:
>>
>>
>> John Huttley wrote:
>>
>>> Hi,
>>> What is the best way of handling CSS?
>>> I've looked at ZStylesheets, but it is buggy and uses depreciated 
>>> functions that will not be available in 2.10.
>>>
>> I recommend a DTML Document as an upgrade to File objects.
>> If you use DTML you can
>> a) easily set some custom cache headers in the css
> 
> Or use a cache manager :-)
> 
>> b) refer to images by a dynamic URL to the imagefolder. *
>>
>> * example:
>> #body { background:#fff url(<dtml-var images url>/bg.png); }
>>
> Which runs against (a) because if you aggressive cache
> (which is a good idea) you shouldn't have dynamic elements
> in it.
> 
> I believe file objects are good enough and you could
> probably split the CSS across some files to get the
> dynamics w/o loosing performance.

I also use DTML for dynamic stylesheets plus a HTTPCacheManager and a 
set_header script to set the text/css media type (and /* vim: set 
syn=css: */).

Only because I'm lazy to change the paths (mainly for @import) in the 
stylesheets.

Tonico



More information about the Zope mailing list