[Seaside] CSSRenderer was: [Fill background with image?]

Avi Bryant avi.bryant at gmail.com
Mon Dec 5 05:01:46 CET 2005


On Dec 4, 2005, at 1:43 PM, Esteban A. Maringolo wrote:

>> Sadly, the style of the component
>> is obtained before that the render begins, and with no context
>> available, so a quick&dirty solution would be:
>>
>
> I was wondering if would be useful to have a #renderStyleOn: css,
> where css would be an WACSSRenderer, then the WACSSRenderer would have
> a context, such as WAHtmlRenderer.

A large part of the point of having external CSS files (like those  
simulated by the #style methods or WAStyleLibrary) is that they are  
static and the browser can cache them.  This keeps bandwidth and  
response times down.  Building up CSS strings dynamically in a #style  
method totally defeats that, and most effects can be better achieved  
by dynamically changing class attrs anyway.  But if you really do  
want dynamic css for some reason, just use something like "html tag:  
'style' do: self myDynamicCSS" to render it inline.  Of course, this  
could certainly be made nicer with something like "html css: [:css |  
self renderDynamicStyleOn: css]", and actually there were some  
changes that did something like that submitted a while ago, but you  
really shouldn't need to use it very often.

Avi


More information about the Seaside mailing list