mellowyellow
29 Jan 2011, 05:50 AM
I'm not an organized person usually - but I'm trying to get there!
So here's a question for you gurus and org freaks out there. How do you organize your CSS?
I have done it usually in sections. For instance, outlining by /* HEADER */, /* FOOTER */, /* LINKS*/, and so on. But one thing I've always done is to only have every style definition once. That is, if there's a div.something, I'll only define properties for div.something in one area.
It's occurred to me that structurally organizing might be better. That is, have a /* LAYOUT */ section, and a /* STYLES */ section. In the layout section, you define the size and margins and floats of div.something. In the /* STYLES */ section, you define the colors and so on.
But this strikes me as a potential well for confusion. What if you accidentally have two different specifications for div.something's color, or padding, for example? It can make it hard to track down problems that result from it. Especially if you take it one step further and separate your CSS into different files, although I suppose that would be the super-modular approach.
Thoughts?
So here's a question for you gurus and org freaks out there. How do you organize your CSS?
I have done it usually in sections. For instance, outlining by /* HEADER */, /* FOOTER */, /* LINKS*/, and so on. But one thing I've always done is to only have every style definition once. That is, if there's a div.something, I'll only define properties for div.something in one area.
It's occurred to me that structurally organizing might be better. That is, have a /* LAYOUT */ section, and a /* STYLES */ section. In the layout section, you define the size and margins and floats of div.something. In the /* STYLES */ section, you define the colors and so on.
But this strikes me as a potential well for confusion. What if you accidentally have two different specifications for div.something's color, or padding, for example? It can make it hard to track down problems that result from it. Especially if you take it one step further and separate your CSS into different files, although I suppose that would be the super-modular approach.
Thoughts?