This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: Organizing my stylesheets
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
I'm back to working on $RAILS_APP full time again. I think my HTML/CSS skills have finally reached the point where I can design a layout that doesn't suck. They're not great, mind you, but at least I don't want to gouge my eyes out any more.
One thing I've learned the hard way is to better organize my stylesheets. My original 'organization' was rather haphazard and too granular. I literally started losing track of which stylesheet applied to which view.
So, I've come to a decision: there shall be one stylesheet per controller, and that shall be applied to each corresponding .rhtml file. I will properly wrap all tables, etc, in their own <div> tags and provide class names as appropriate. Thus, users.css will be used for show.rhtml, list.rhtml, etc, for the Users' view. The <div> tag id's and class names will be used to delineate between .rhtml files, where necessary.
Keep in mind that I'm using a relatively light amount of CSS in general - less than 1 page of text per stylesheet.