How to CSS

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?

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,

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.

How do you organize that?

The latter way.

Ok.

Also, take a look at
http://www.alistapart.com/articles/progressiveenhancementwithcss. The
article recommends ways for splitting up your CSS.

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,