[Seaside] Dynamic CSS

Boris Popov boris at deepcovelabs.com
Thu Dec 4 21:30:48 UTC 2008

If your stylesheet includes all possible styles for your site and is
quite large you have to keep in mind that browsers are smart enough to
cache it which means users only need to download it once; if you
generate stylesheets dynamically for every page they might be smaller,
but browser will need to always download them and you lose caching. I'd
go for the first, especially considering effects of minifying and
delivery compression.


DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

boris at deepcovelabs.com


This email is intended only for the persons named in the message header.
Unless otherwise indicated, it contains information that is private and
confidential. If you have received it in error, please notify the sender
and delete the entire message including any attachments.

Thank you.
-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org
[mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of
Sent: Thursday, December 04, 2008 1:28 PM
To: seaside at lists.squeakfoundation.org
Subject: [Seaside] Dynamic CSS


My application has a number of components subclassed from 
WAComponent,e.g., VeHeader, VeFooter, VeArtist, VeArtifact etc.

The html pages that I dynamically produce can contain any subset of my 
"VeComponents" (the things I subclassed from WAComponent).  My question 
concerns the creation of the css for my dynamically produced html pages.

Because I create the html page contents on the fly, I have no way of 
knowing which of my VeComponents will be include on an html page. My 
solution creates a style sheet that consists of the styling for ALL 
possible VeComponents and its contained components.  The resulting style

sheet is quite large.

Many times there is only one VeComponent on the page yet I have this 
massive style sheet to handle the set of all possible VeComponents.

There has to be a better way.  I was using the #style  method for each 
of my VeComponents but I have learned from this forum that this is not a

good solution and performance will not be good.

I think this all boils down to one question: Is there a way to generate 
a dynamic css that would not degrade performance?


seaside mailing list
seaside at lists.squeakfoundation.org

More information about the seaside mailing list