Re: [Zope] best practice, CSS Stylesheets

2006-03-21 Thread Peter Bengtsson



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
b) refer to images by a dynamic URL to the imagefolder. *

* example:
#body { background:#fff url(dtml-var images url/bg.png); }



All advice welcome,
--John


___
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 )



--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
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 )


Re: [Zope] best practice, CSS Stylesheets

2006-03-21 Thread Tino Wildenhain

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.

++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 )


Re: [Zope] best practice, CSS Stylesheets

2006-03-21 Thread Peter Bengtsson



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



--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
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 )


Re: [Zope] best practice, CSS Stylesheets

2006-03-21 Thread David Pratt
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




___
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 )


Re: [Zope] best practice, CSS Stylesheets

2006-03-21 Thread Tino Wildenhain
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.

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 )


Re: [Zope] best practice, CSS Stylesheets

2006-03-20 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 20 Mar 2006, at 22:26, 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.


They are just simple text files and do not need any handling. You  
could just put them in a simple Zope File object, give it content  
type text/css, and be done with it.


jens

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFEHzjjRAx5nvEhZLIRAsz1AJ9UmzAkpjHYfq96MkVFoJTJg19MhACePPa9
71huwoMNp75MkxpD2lBBNWk=
=Oig9
-END PGP SIGNATURE-
___
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 )