I gotta say this is one place where the cgi "handler" trick is useful. If you are HTML::Mason'ing or other meta-content generator, this is even easier. just link the users stylesheet to a url like this:
<LINK rel=STYLESHEET TYPE="text/css" href="/style/USERNAME.css"> # style is a CGI/handler in the main path

Now when you generate the CSS code for them it "looks" like it's coming from a file and you can further spoof browsers into caching the data by sending the header:

Last-Modified: Fri, 22 Sep 2000 19:24:17 GMT

If you store a last changed date with the users prefs, you can make a cheesy HEAD/Conditional-GET that just grabs the change date and returns the 304 Unchanged response if the dates match. With just a little more work, the browsers cache the stylesheet and you beat up on your DB just a little less. That is a bandwidth and sanity win all the way around.

There are a lot more tweaks you can throw at it. I've got a conditional handler laying about somewhere for Mason, I think. I started to do this very same thing but haven't yet bothered with customizability since I'm working real functionality on the site I'm doing.

--
$you = new YOU;
honk() if $you->love(perl)


In reply to RE: Parsing and Spewing CSS by extremely
in thread Parsing and Spewing CSS by davemabe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.