[Seaside] CSS Files vs. #style

Nevin Pratt nevin at bountifulbaby.com
Sun May 6 01:14:08 UTC 2007

I've read previous posts (by Avi as well as others) saying that they 
typically didn't implement the method #style on a component, but instead 
typically used #updateRoot: and #resourceUrl: to invoke external CSS 
files.  For example, Philippe Marschall wrote the following example of 
use (on 7/27/06):

   MyRootComponent >> #updateRoot: anHtmlRoot
       super updateRoot: anHtmlRoot.
       anHtmlRoot linkToStyle: 'wherever/style.css'.
       anHtmlRoot linkToScript: 'wherever/script.js'.

And, of course, this works fine, and presumably allows your web 
designers to easily change the CSS layout.

But then, so did the #style method.  And, it also is easy for your web 
designers to change the CSS layout-- by toggling the halos and entering 
the CSS code in the browser (via the style editor, which is the little 
pencil icon when you turn halos on).  And, when they do it this way, it 
compiles the CSS code into the #style method of the component, thus 
allowing you to carry the styles around with your image.  And that 
reduces dependencies, because it keeps everything in the image, instead 
of splitting it out into external files.

So, why are folks avoiding the #style method?  What am I missing?


More information about the seaside mailing list