[Seaside] How to load my own CSS files...

Michel Bany m.bany at wanadoo.fr
Tue Mar 7 09:05:15 UTC 2006

On 06 Mar 2006, at 23:31 , Rick Flower wrote:

> Michel Bany wrote:
>> Rick Flower a écrit :
>>> For the time being, since I couldn't figure out how to do it, I  
>>> just cut-n-pasted the contents of my css files
>>> into my top-level style method, which achieves the same goal, but  
>>> is not really what I'd like to do overall.
>> Still, I see a big benefit in having the css stylesheets  
>> implemented as Smalltalk code.
>> The versions of the css stylesheets and the version of the code  
>> are guaranteed to be in synch.
>> Did you consider using style libraries ?
> No.. Can you elaborate what a style library is?

A style library is a subclass of WAStyleLibrary where each instance  
method answers a css stylesheet.
WAStandardStyles can be used as an example. Note that you also have  
subclasses for Javascript libraries.

You relate your application to one or more style libraries using the  
Seaside config tool.
Or you can do it programmatically in the #initialize method

		| app |
		app := self registerAsApplication: 'foo'.
		app  libraries add: MyFirstStyleLibrary.
		app  libraries add: MySecondStyleLibrary.
		app libraries add: MyJavascripts.

>   I think one of the reasons I like to modify my stylesheets
> as an external entity from the Seaside environment is that it's  
> easier and frequently nicer to use a CSS
> editor to see in realtime what sorts the settings will look like  
> without using the browser.  However, I'm
> intrigued by the concept of a library of styles.. I'm open to using  
> something new and thinking about
> things in a different manner -- that's how I stumbled across  
> Seaside & Smalltalk and now have the
> entire front-end of my application running in no short order!

I agree that you should use a CSS editor (like Xyle) for helping you  
building the stylesheets. I am only
suggesting that the stylesheets should be stored into style libraries  
and served from there. The only tricky
issue is how you store the stylesheets into the Smalltalk image. Copy/ 
paste is one way. FTP is another way


> -- Rick
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the Seaside mailing list