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 P. 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,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

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.

On Tue, Aug 3, 2010 at 12:42 PM, Fernando P. [email protected]
wrote:

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 P. 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,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs