In theory, you shouldn't have many problems always including CSS *and*
always serving something that is nice and accessible. CSS is capable of
repositioning everything, and if you are willing to use conditional
comments[1] getting it all to work in IE isn't *too* painful. The
problem is that at that point you are relying on CSS entirely for your
page layout, which is admirable but not always the most efficient way
to get things done.

If you are looking to conditionally do anything, I would advise using
the user agent string that the browser reports. You can access this
from the server using:

cherrypy.request.headers["User-Agent"]

A sample value looks something like this:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060124
Firefox/1.5.0.1

>From there you have just about all the info you need, and can define
different styles for each. It looks like there are some decent sites on
the net that classify user agents by purpose (download/bot/browser/etc)
so you can use that to figure everything out. From there your control
is pretty granular, and you can use JSLink and CSSLink widgets to
dynamically add and remove javascript/CSS resources from your template.
(as well as conditionally changing the whole thing).

Let me know if you need pointers for anything. It sounds like a
comprehensive user agent classifier would be a somewhat useful
resource. At the least it would be simpler to use than relying on JS to
handle things, and handles the (relatively rare, to answer your
question) cases where JS is disabled more elegantly.

-Adam

[1] http://www.quirksmode.org/css/condcom.html


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to