[Seaside] Self adjusting CSS (based on browser type) extension to Seaside?

Jason Johnson jbjohns at libsource.com
Mon Nov 6 21:06:52 UTC 2006


I disagree that seaside itself needs to know about this or how to do it, 
but it is trivial to sniff the browser yourself from inside seaside (I 
don't remember what class to subclass, something "root" I think.  I will 
dig it up for you if you need me to).

Rick Flower wrote:
> I just tested an app I've been working on (tested mostly in Safari & 
> Firefox which look fine) but this time tried it on IE6 and it looks 
> really bad -- mostly due to font differences (fonts are huge which are 
> causing wrapping) which I've yet to account for in my existing CSS.. 
> It got me to thinking about ways to have some sort of system in 
> Seaside were you could specify portable font sizes or types (and 
> whatever else) in your CSS style methods that Seaside could then 
> translate into the proper actual CSS code on-the-fly for the specific 
> browser being used..  What I'm thinking is that you could have CSS 
> that looks something like that shown below in the before/after code :
>
> *_Before Modification_* (e.g. plain old CSS)
>
> div#byitem ul.vert
> {
>         list-style-type: none;
>         padding: 0;
>         margin: 0;
>         width: 640px;
>         font-size: 9pt;
>         font-family: "Courier New", Courier, Arial, sans-serif, monospace;
> }
>
> *_After Modification_*
>
> div#byitem ul.vert
> {
>         list-style-type: none;
>         padding: 0;
>         margin: 0;
>         width: 640px;
>         @font-size: 9pt;
>         @font-family: monospace;
> }
>
> This way, some new code in Seaside could see that you're using IE 6 
> (for instance -- perhaps IE7 behaves different) and modify the 
> font-size and font-family accordingly to make something that works 
> better for IE -- e.g. tailoring if you will.  Right now, there's no 
> clean way aside from doing ugly css hacks to get IE to do what you 
> want without breaking the formatting for Firefox/Safari,etc.. This way 
> is more programmatic and you could have a collection of substitutions 
> based on browser type and keyword or something along those lines.. The 
> nice thing about such a mechanism is that you could totally skip it if 
> you didn't want to use it.. Perhaps this is just not needed as there 
> are so many browser quirks out there -- Anyway, not sure if anyone has 
> any comments on whether this sounds interesting or not...?
> ------------------------------------------------------------------------
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>   



More information about the Seaside mailing list