[Seaside] style

Philippe Marschall philippe.marschall at gmail.com
Tue Oct 14 06:41:59 UTC 2008

2008/10/14 Squeaker <squeakman at gmail.com>:
> Greetings,
> In past postings I have read that it is not recommended to use the #style
> method in a component, instead we should use a static style sheet.
> In a previous posting (that I can no longer find) it was pointed out that
> using the #style method would probably be inefficient and give a bad user
> experience.
> I am now using the #updateRoot: method and aWAFileLibrary to add my "static"
> style sheet and things seem to work. But, is this really different than
> implementing  the #style method in my component? If yes, the how is it
> different and what makes it more efficient?

#updateRoot: does not have anything to do with it. Especially if you
use WAFileLibrary you shouldnpt use #updateRoot: and instead add the
library to your application.

Using #style means the browser has to request a CSS for ever component
instance implementing #style on a given page. They can not be cached.
Using proper CSS files not only reduces the amout of CSS documents a
browser has to fetch but also allows the browser to cache them
resulting in far fewer request for rendering a page.

Note however that WAFileLibrary as well as #style is not recommended
for production use. For production use stand alone files and a web
server like Apache. It will offload work form your Smalltalk image.


More information about the seaside mailing list