[Seaside] Styles on 2.5b2

Avi Bryant avi at beta4.com
Thu Aug 26 13:21:31 CEST 2004


On Aug 22, 2004, at 8:28 PM, Sebastian Sastre wrote:

> Hi all,
>    
>      I've used to edit the (olny) css property from the halos in the 
> previous seaside version. Now I've upgraded it and I've tried to 
> figure out how the styles can be driven from the halos interfaces but 
> I'm lost. Then I've tried from the image itself, but I'm lost too.

Well, from the image you can still put a #style method on any component 
and it will work.  However, in 2.5b I've been trying to decouple style 
methods from components, by moving them instead into CSS "libraries" - 
classes that contain nothing but CSS strings.  This is fundamentally a 
packaging issue.  The problem is that if I'm using a component from 
package A in my package B, I may well want to change its style to match 
the look of my application.  However, overriding #style can quickly get 
messy, especially if multiple packages in the same image want to use 
the component at once, each with a different look.  You could allow 
multiple style methods on a single component, each in a different 
package, and use an SUnit-like trick of having selector naming 
conventions (styleFoo, styleBar, styleBaz, etc), but that still doesn't 
seem ideal.  Whereas if the styles are in a completely separate class, 
it's easier to partition them properly across packages, and to tell 
which methods contain style info, which contain script info, etc, 
without having to parse selectors.  Kamil's recent suggestion, which I 
think is a good one, is to have a whole class per script or stylesheet, 
which allows you to easily set attributes like "media", rather than 
just provide the source.  But I haven't had time to do that refactoring 
yet.

The obvious problem with separating the styles out from the components 
is that it becomes less obvious where to go when you are looking at a 
specific component on a page and want to change the way it looks.  This 
is a tool support problem, and although I've started providing tools to 
help with this, they still need a lot of work.  When you click on the 
style halo, what you get is basically a specialized system browser for 
the style library classes: it lets you edit the source strings directly 
(so you don't have to worry about escaping single quotes) of all of the 
style methods in each library.  But it also has a search facility, and 
when you click on the style halo of a particular component, it will use 
the search to find the most applicable stylesheet and preselect that 
for editing.  The problem is that most CSS is still in #style methods 
on individual components, which don't show up in this browser - so it's 
quite likely that the search won't find any applicable methods at all.  
This is a bug, and I expect it to be fixed before we're out of beta.

A word about timelines: I've spent the last few weeks moving 
(temporarily) from Canada to the Netherlands, and am just now starting 
a new long term contract.  I've also been without good internet access 
until just recently.  Between getting settled, getting connectivity, 
dealing with the paperwork of living and working in a new country, and 
getting up to speed on a new codebase, I haven't had a lot of time to 
hack Seaside or answer emails.  So if I seem less together than usual, 
I apologize.  After ESUG, things should be back to normal, and I would 
expect to see some major activity on Seaside again in early October.

Cheers,
Avi


More information about the Seaside mailing list