Forum: Ruby on Rails [OT] Serving Multiple Stylesheets

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Steve R. (Guest)
on 2006-04-14 22:49
(Received via mailing list)
I was wondering whether there is unbearable overhead involved in
breaking css
into multiple stylesheets? I'm running lighttpd, and the following
article
discusses why one might want to do that:

http://justinfrench.com/?id=141

My CSS is beginning to get a bit lumpy to digest in one glance and the
article(s) seem to make a cogent argument for separating functional
elements
out. I just wanted to make sure there weren't any Rails or server issues
that would be problematic.

TIA
--
View this message in context:
http://www.nabble.com/-OT-Serving-Multiple-Stylesh...
Sent from the RubyOnRails Users forum at Nabble.com.
Philip H. (Guest)
on 2006-04-14 22:55
(Received via mailing list)
> I was wondering whether there is unbearable overhead involved in breaking css
> into multiple stylesheets? I'm running lighttpd, and the following article
> discusses why one might want to do that:
>
> http://justinfrench.com/?id=141
>
> My CSS is beginning to get a bit lumpy to digest in one glance and the
> article(s) seem to make a cogent argument for separating functional elements
> out. I just wanted to make sure there weren't any Rails or server issues
> that would be problematic.

We're not in production yet, but I don't see why splitting it up in
rails/lighty would be any different than splitting it up for any other
environment.

In our case, we put this at the top of our default layout:

<%= stylesheet_link_tag controller.controller_name %>

Then for each controller we create
public/stylesheets/controller_name.css
file.  For those few sections that don't have specific styles we have
an empty style sheet.

Yeah, it's one more file to download, but it will only happen once per
browser (for the most part).

Well worth the sanity I'd say...

-philip
This topic is locked and can not be replied to.