Re: [Zope] Re: best practice, CSS Stylesheets
Tonico Strasser wrote: > Tino Wildenhain schrieb: >> David Pratt schrieb: >>> 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. >> >> What do you expect to change with Z3? Otoh, not using runtime-generated >> CSS is usually a better approach anyway. > > Just out of interest, why do you think this is *usually* better? This > does strongly depend on your use case, no? > > You could say something like "it is usually better to serve static HTML > pages" as well. > usually = significantly more then 50% of the time ;) better = when the web application is faster and easier to maintain :-) with CSS coming slow from server its even worser then dynamic pages when they get slow - you see the page and then while you look or even start to scroll, elements jump around/get recolored while CSS arrives. I'd try to avoid this. Regards Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: best practice, CSS Stylesheets
Tino Wildenhain schrieb: David Pratt schrieb: 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. What do you expect to change with Z3? Otoh, not using runtime-generated CSS is usually a better approach anyway. Just out of interest, why do you think this is *usually* better? This does strongly depend on your use case, no? You could say something like "it is usually better to serve static HTML pages" as well. Tonico ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: best practice, CSS Stylesheets
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(/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 ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )