CSS style - static vs dynamic

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

CSS style - static vs dynamic

squeakman
Greetings,

I have read on the Seaside tutorial that #style > should return static
(not generated) string literals containing snippets of CSS

I have experimented with returning a dynamic string, generated at
runtime, and things appear to work.

I know that one disadvantage is that using the css with the halos will
over-write my #style method but this is a tradeoff I am willing to live
with.

My question: What is the problem with generating the style string on the
fly?

Thanks,
Frank

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: CSS style - static vs dynamic

Stefan Schmiedl
On Tue, 04 Mar 2008 16:35:22 -0500
Squeaker <[hidden email]> wrote:

> My question: What is the problem with generating the style string on the
> fly?

Performance will suffer, as you'll
a) have to generate the CSS content on the server
b) have to get it to the client every time it has been generated

Depending on your environment, these might be of no concern.

s.
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: CSS style - static vs dynamic

Lukas Renggli
In reply to this post by squeakman
>  My question: What is the problem with generating the style string on the
>  fly?

It certainly works, but it is just not the way CSS and XHTML are
supposed to interact together. The web browser and Seaside won't give
you and your users the performance and experience one would expect:

- You application will be noticeably slower, because the web browser
has to do two sequential requests, one for the XHTML and one for the
changed CSS.

- Seaside will eat up much more memory, because it will need to serve
all the different CSS styles from a cache.

In my opinion it is much easier to change some CSS classes in the
XHTML to configure the look with predefined styles.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside