[Seaside] Support for CSS?

Nevin Pratt nevin@smalltalkpro.com
Thu, 25 Apr 2002 15:25:17 -0600


Avi Bryant wrote:

>On Thu, 25 Apr 2002, Nevin Pratt wrote:
>
>>So, does Seaside support CSS?  (either as an external file reference or
>>inline)
>>
>
>Both work, in SSVS.  <link> works just like <image>, so you can put
>external .css files wherever you're putting  your .jpgs, and inline style
>blocks work mostly because of the same hack that messes up <body>, which
>is that all of the head blocks from nested subcomponents are collected
>into the top-level <head>.  This means that little widgets/subcomponents
>can add their own <style> or <link> tags without too much trouble.
>
>The other thing Seaside does to support it is automatically insert CSS id
>attributes to match the sea:id attributes on dynamic tags, so <a
>href="@foo"> becomes <a href="/some/generated/url" id="foo">.
>
>This is all still definitely alpha code, so if you can bang on it a bit,
>that's great.  It would be nice to get it cleaned up and release 0.93.
>


For the following, note that my #html method fetches the html from a file:

I've tried the following embedded CSS code within the header area of an 
html file (both with and without the quotes around the background image 
URL), and it doesn't seem to be expanded by Seaside (I've set the 
document root of the Seaside app to 'http://www.test.com').  Instead, it 
seems to be treated as literal text, and thus the browser receives it 
just like this, and of course can't make sense of the '@' in the URL.

   <style type="text/css">
   <!--
   body {background-image: url(@images/background.jpg)}
   -->
   </style>
   </head>

Note, however, that the following works just fine when placed in an html 
file (on my internal network where www.test.com is locally defined as my 
own machine).  Again, it seems to be treated as literal text by Seaside, 
and thus it is returned to the browser as content, and the browser makes 
sense of it just fine and fetches the background image:

   <style type="text/css">
   <!--
   body {background-image: url(http://www.test.com/images/background.jpg)}
   -->
   </style>
   </head>

Also, I might add, I have workarounds for *every* issue I've brought up, 
including this one.  I just don't want to propogate them.

Nevin