Hmm - we're currently debating what to do about dynamic css on our
project (Ruby on Rails based)
There seem to be a few options:
- No dynamic css at all
- Simple templated stuff, where the code is basically css + inline ruby:
    #whatever { background-color : <%= background_colour %>; }
- Something that builds css from a difference css-like language like
Sass: http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html
- Or something else...

I'd be interested in the thoughts of folks here.  A simple template
would have the advantage of (possibly) working well in css editors and
tools; but there also seems to be some buzz around tools like Sass
that take some more repetition out of the CSS.

Or is there something else we should look at?  Really, mostly we are
just looking for ways to avoid too much repetition - it'd be good to
avoid endlessly repeating colour codes and font sizes all over the
place, when we have a server-side language available that could build
our css for us.

- Korny

On Fri, May 9, 2008 at 3:13 PM, Adam Martin <[EMAIL PROTECTED]> wrote:
> We use a very similar approach - php to deliver the css.
> This allows us to do some very cool things, such as target browsers with
> simple comments
>
> For example:
>
> /* IE
> button {
>    width: auto;
>    overflow: visible;
> }
> button span {
>    margin-top: 2px;
> }
> */
>
> or we can even target browser versions
>
> /* IE6
> button {
>    width: auto;
>    overflow: visible;
> }
> button span {
>    margin-top: 2px;
> }
> */
>
> or even browsers and operating systems
>
> /* Opera 9.10 Win
> button {
>    width: auto;
>    overflow: visible;
> }
> button span {
>    margin-top: 2px;
> }
> */
>
> We also store basic css configuration into a config.ini file that can be
> read by the php script, for example:
>
> #---------------------------------#
> # LAYOUT DEFINITION
> #       style1 centered content, header and footer are fullscreen width
> #       style2 fullscreen
> #       style3 centered
> #       style4 header fullscreen, everything else centered
> #       style5 footer fullscreen, everything else centered
> #---------------------------------#
>
> layout.style            = style3;
> layout.width            = 758;
> left.width              = 185;
> right.width             = 0;
> header.display          = true;
> footer.display          = true;
> body.bg                 = #FFF;
> header.bg               = #FFF;
> left.bg                 = #dae2f0;
> right.bg                = #78746E;
> main.bg                 = #FFF;
> footer.bg               = #FFF;
>
> this sets up our basic layout for us, very quickly and easily. The true
> power is in using some logic to produce the cs is that is needed. We can
> then compress it all nicely, add a future expiry date, cache and we are good
> to go.
>
> Sorry, this seemed to get completely off topic, but I am sure it will spark
> some conversations :)
> Cheers
> Adam
>
>
>
> On Fri, 09 May 2008 14:46:34 +1000, David Hucklesby <[EMAIL PROTECTED]>
> wrote:
>
>> On Tue, 6 May 2008 19:19:24 +0530, Amrinder wrote:
>>>
>>> I was reading this article on Smashing Magazine which shows how to
>>> increase code
>>> readability,
>>>
>>> http://www.smashingmagazine.com/2008/05/02/improving-code-readability-with-css-
>>> styleguides/
>>>
>>> but I have listened to Andy Clarke over Lynda.com saying that one should
>>> save the white
>>> space as it increases the file size.
>>>
>>
>>
>> Ted Drake replied:
>>>
>>> Reduce the number of css files used
>>> Link to them in the top of the page, no inline styles
>>> Gzip and reduce the whitespace when going to production.
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> A job for a server-side script. See:
>>
>>  <http://www.coolphptools.com/dynamic_css>
>> Cordially,
>> David
>> --
>>
>>
>>
>>
>> *******************************************************************
>> List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
>> Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
>> Help: [EMAIL PROTECTED]
>> *******************************************************************
>>
>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>
>
> *******************************************************************
> List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
> Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
> Help: [EMAIL PROTECTED]
> *******************************************************************
>
>



-- 
Kornelis Sietsma korny at my surname dot com


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to