# How to CSS

**URL:** <https://discuss.rubyonrails.org/t/how-to-css/53375>\
**Category:** rubyonrails-talk\
**Created:** [August 3, 2010, 3:46pm UTC](https://discuss.rubyonrails.org/t/how-to-css/53375 "2010-08-03T15:46:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [August 3, 2010, 3:46pm UTC](https://discuss.rubyonrails.org/t/how-to-css/53375/1 "2010-08-03T15:46:37Z")

</div>

Hi,

It's not specifically related to Rails, but how do you arrange your CSS files?

I used to dump everything in a gigantic screen.css file. Then I noticed that some rules only appeared in a few pages.

Therefore I am considering having a layout.css for all pages and roughly 1 css file per controller if I need specific things in it that are not found in layout.css.

How do you organize that?

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [August 3, 2010, 3:54pm UTC](https://discuss.rubyonrails.org/t/how-to-css/53375/2 "2010-08-03T15:54:29Z")

</div>

Fernando Perez wrote:

> Hi,
> 
> It's not specifically related to Rails, but how do you arrange your CSS files?
> 
> I used to dump everything in a gigantic screen.css file. Then I noticed that some rules only appeared in a few pages.
> 
> Therefore I am considering having a layout.css for all pages and roughly 1 css file per controller if I need specific things in it that are not found in layout.css.
> 
> How do you organize that?

The latter way. I also \*highly\* recommend using Sass: CSS alone is not powerful enough to fully separate content from presentation in a maintainable way -- Sass' higher-level abstractions are necessary here.

Best,

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [August 3, 2010, 4:42pm UTC](https://discuss.rubyonrails.org/t/how-to-css/53375/3 "2010-08-03T16:42:32Z")

</div>

> > How do you organize that?
> 
> The latter way.

Ok.

> I also \*highly\* recommend using Sass: CSS alone is not powerful enough to fully separate content from presentation in a maintainable way -- Sass' higher-level abstractions are necessary here.

I find sass "ugly", and I reviewed "less", but in the end I stayed with pure css.

---

<div class="post-metadata">

**Author:** ![Bob\_Nadler1](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@Bob\_Nadler1](https://discuss.rubyonrails.org/u/Bob_Nadler1)\
**Post date:** [August 3, 2010, 4:59pm UTC](https://discuss.rubyonrails.org/t/how-to-css/53375/4 "2010-08-03T16:59:01Z")

</div>

> > > How do you organize that?
> > 
> > The latter way.
> 
> Ok.

Also, take a look at [Progressive Enhancement with CSS – A List Apart](http://www.alistapart.com/articles/progressiveenhancementwithcss). The article recommends ways for splitting up your CSS.

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [August 3, 2010, 5:02pm UTC](https://discuss.rubyonrails.org/t/how-to-css/53375/5 "2010-08-03T17:02:29Z")

</div>

Fernando Perez wrote:

> > > How do you organize that?
> > 
> > The latter way.
> 
> Ok.
> 
> > I also \*highly\* recommend using Sass: CSS alone is not powerful enough to fully separate content from presentation in a maintainable way -- Sass' higher-level abstractions are necessary here.
> 
> I find sass "ugly", and I reviewed "less", but in the end I stayed with pure css.

That is a bad idea. You should learn Sass well enough to be able to use it to clean up your markup. If you're using plain CSS, you're working too hard.

I've noticed that you tend to disparage tools outside a fairly narrow comfort zone, even when those tools could materially help you. May I suggest broadening your horizons a bit?

Best,
