[Zope] best practice, CSS Stylesheets

David Pratt fairwinds at eastlink.ca
Tue Mar 21 15:47:44 EST 2006


Anyone have any idea whether dynamic css via dtml will remain possible 
as CMF gets more Z3'ish? Or will only possibility be overrides in css 
itself.

Regards,
David

Peter Bengtsson wrote:
> 
> 
> Tino Wildenhain wrote:
> 
>> 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 :-)
> 
> true
> 
>>
>>> 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.
> 
> You mustn't use any dtml-if or other crap like that because then, as you 
> say Tino, you lose the ability cache the css file.
> 
>>
>> 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.
>>
>> ++Tino
>>
> 


More information about the Zope mailing list