Dynamic CSS

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

Dynamic CSS

squeakman
Greetings,

My application has a number of components subclassed from
WAComponent,e.g., VeHeader, VeFooter, VeArtist, VeArtifact etc.

The html pages that I dynamically produce can contain any subset of my
"VeComponents" (the things I subclassed from WAComponent).  My question
concerns the creation of the css for my dynamically produced html pages.

Because I create the html page contents on the fly, I have no way of
knowing which of my VeComponents will be include on an html page. My
solution creates a style sheet that consists of the styling for ALL
possible VeComponents and its contained components.  The resulting style
sheet is quite large.

Many times there is only one VeComponent on the page yet I have this
massive style sheet to handle the set of all possible VeComponents.

There has to be a better way.  I was using the #style  method for each
of my VeComponents but I have learned from this forum that this is not a
good solution and performance will not be good.

I think this all boils down to one question: Is there a way to generate
a dynamic css that would not degrade performance?

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: Dynamic CSS

Boris Popov, DeepCove Labs (SNN)
If your stylesheet includes all possible styles for your site and is
quite large you have to keep in mind that browsers are smart enough to
cache it which means users only need to download it once; if you
generate stylesheets dynamically for every page they might be smaller,
but browser will need to always download them and you lose caching. I'd
go for the first, especially considering effects of minifying and
delivery compression.

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5
http://tinyurl.com/r7uw4

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message header.
Unless otherwise indicated, it contains information that is private and
confidential. If you have received it in error, please notify the sender
and delete the entire message including any attachments.

Thank you.
-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of
Squeaker
Sent: Thursday, December 04, 2008 1:28 PM
To: [hidden email]
Subject: [Seaside] Dynamic CSS

Greetings,

My application has a number of components subclassed from
WAComponent,e.g., VeHeader, VeFooter, VeArtist, VeArtifact etc.

The html pages that I dynamically produce can contain any subset of my
"VeComponents" (the things I subclassed from WAComponent).  My question
concerns the creation of the css for my dynamically produced html pages.

Because I create the html page contents on the fly, I have no way of
knowing which of my VeComponents will be include on an html page. My
solution creates a style sheet that consists of the styling for ALL
possible VeComponents and its contained components.  The resulting style

sheet is quite large.

Many times there is only one VeComponent on the page yet I have this
massive style sheet to handle the set of all possible VeComponents.

There has to be a better way.  I was using the #style  method for each
of my VeComponents but I have learned from this forum that this is not a

good solution and performance will not be good.

I think this all boils down to one question: Is there a way to generate
a dynamic css that would not degrade performance?

Thanks,
Frank

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

Re: Dynamic CSS

Peter Osburg-2
In reply to this post by squeakman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Hey Frank,

Maybe you want to take a look at this:
http://peter-osburg.ehstpro.de/2008/11/13/changing-css-during-run-time-of-your-web-application/

In this case I created a solution where I use a file library to store
my css files and to change them dynamically. Maybe it can help you
finding a solution for your case.

Maybe you can also consider using the css keyword @import for
dynamically changing the content:
http://webdesign.about.com/cs/css/qt/tipcssatimport.htm

Hope that helps.

Regards,
Peter

Squeaker schrieb:

> Greetings,
>
> My application has a number of components subclassed from
> WAComponent,e.g., VeHeader, VeFooter, VeArtist, VeArtifact etc.
>
> The html pages that I dynamically produce can contain any subset of
> my "VeComponents" (the things I subclassed from WAComponent).  My
> question concerns the creation of the css for my dynamically
> produced html pages.
>
> Because I create the html page contents on the fly, I have no way of
> knowing which of my VeComponents will be include on an html page. My
> solution creates a style sheet that consists of the styling for ALL
> possible VeComponents and its contained components.  The resulting
> style sheet is quite large.
>
> Many times there is only one VeComponent on the page yet I have this
> massive style sheet to handle the set of all possible VeComponents.
>
> There has to be a better way.  I was using the #style  method for
> each of my VeComponents but I have learned from this forum that this
> is not a good solution and performance will not be good.
>
> I think this all boils down to one question: Is there a way to
> generate a dynamic css that would not degrade performance?
>
> Thanks,
> Frank
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iEYEARECAAYFAkk4V64ACgkQ0qdvZsCNFKFecwCeLUbXWYMzc3C8swa+BL2FHlDJ
qr4An2QdVWsxiSyZ7FUA50qKXVT+4dPi
=7yDB
-----END PGP SIGNATURE-----

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside