# CSS best practices?

**URL:** <https://www.ruby-forum.com/t/css-best-practices/130833>\
**Category:** Rails\
**Created:** [March 3, 2008, 7:26pm UTC](https://www.ruby-forum.com/t/css-best-practices/130833 "2008-03-03T19:26:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff\_wigal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@jeff\_wigal](https://www.ruby-forum.com/u/jeff_wigal)\
**Post date:** [March 3, 2008, 7:26pm UTC](https://www.ruby-forum.com/t/css-best-practices/130833/1 "2008-03-03T19:26:28Z")

</div>

I’m starting a new Rails project, and I have all of my CSS lumped into  
a single style sheet. I am guessing this probably is not the best way  
to keep this organized. Does anyone have any tips on how to keep CSS  
organized, DRY, and easy to maintain within Rails?

The project will likely have 3 or 4 layouts, a consistent look-and-  
feel across the project, but the different layouts will have their own  
small differences between them.

Thanks in advance–

Jeff Wigal

---

<div class="post-metadata">

**Author:** ![jeff\_wigal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@jeff\_wigal](https://www.ruby-forum.com/u/jeff_wigal)\
**Post date:** [March 3, 2008, 11:33pm UTC](https://www.ruby-forum.com/t/css-best-practices/130833/2 "2008-03-03T23:33:09Z")

</div>

Probably you should get this question sorted out at  
[http://www.css-discuss.org/](http://www.css-discuss.org/)

– sekhar

On Mon, Mar 3, 2008 at 1:25 PM, jeff\_wigal [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![jeff\_wigal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d2c977/32.png) [@jeff\_wigal](https://www.ruby-forum.com/u/jeff_wigal)\
**Post date:** [March 4, 2008, 12:12am UTC](https://www.ruby-forum.com/t/css-best-practices/130833/3 "2008-03-04T00:12:22Z")

</div>

I like to use:

[http://blog.airbladesoftware.com/2006/12/11/cssdryer-dry-up-your-css](http://blog.airbladesoftware.com/2006/12/11/cssdryer-dry-up-your-css)

for starters.

I also like running my CSS through ERB in the manner of:

[http://blog.hasmanythrough.com/2007/10/18/simpler-than-dirt-restful-dynamic-css](http://blog.hasmanythrough.com/2007/10/18/simpler-than-dirt-restful-dynamic-css)

Also, have a look at:

[http://nubyonrails.com/articles/dynamic-css](http://nubyonrails.com/articles/dynamic-css)
