1

I'm asking this question purely from an ease-of-development standpoint.

Performance is not a consideration, because we will have a build process that combines and compresses all our CSS files into a single file for release and then compresses it.

But which will be easier for a team of front-end developers to work with? Multiple files or a single file that is separated into distinct sections through comments?

Jonathan
  • 32,202
  • 38
  • 137
  • 208
  • possible duplicate of [One massive CSS - or lots of little ones?](http://stackoverflow.com/questions/1525107/one-massive-css-or-lots-of-little-ones) – Matt Mitchell Jul 02 '10 at 04:07
  • Asked so many times before and they would have appeared when you were typing your question. – Matt Mitchell Jul 02 '10 at 04:07
  • I know you said not for performance, but many answers here will be applicable: http://stackoverflow.com/questions/3128479/for-performance-use-one-or-several-css-files – TomWilsonFL Jul 02 '10 at 04:07
  • Seriously, this is like the same title as the other one. – Pierreten Jul 02 '10 at 04:09
  • 4
    boy they came after you jon... you chuds shouldn't downvote for a repeat question... advise him and move on smartly – Hardryv Jul 02 '10 at 04:10
  • @Hardryv when it's nearly the same title it seems warranted. – Matt Mitchell Jul 02 '10 at 04:13
  • 1
    http://www.sadanduseless.com/wp-content/uploads/2010/06/696.jpg – Marko Jul 02 '10 at 04:15
  • This is NOT a repeat question. I'm asking it from a code-quality and ease-of-development standpoint not from a performance standpoint. – Jonathan Jul 02 '10 at 04:18
  • http://stackoverflow.com/questions/1525107/one-massive-css-or-lots-of-little-ones – Pierreten Jul 02 '10 at 04:23
  • @Pierreten, This is NOT a repeat question. I'm asking it from a code-quality and ease-of-development standpoint not from a performance standpoint. – Jonathan Jul 02 '10 at 04:28
  • http://stackoverflow.com/questions/3163183/lots-of-small-css-files-or-one-big-one-with-sections-from-a-code-quality-standp – Pierreten Jul 02 '10 at 05:27

1 Answers1

5

If you're going to join and compress all the files at a later stage - I would most certainly split them into multiple files and organise them accordingly.

Check out how jQuery UI organise their CSS files, they have about 7 CSS files, and 1 main file which imports all 7 using the @import statement. This might be useful to you so you don't have to have 7 <link rel="stylesheet" /> references.

Also make sure you order them accordingly so that any overrides are always at the bottom.

Good luck

Marko

Marko
  • 71,361
  • 28
  • 124
  • 158
  • Thanks Marco. I'll have a look at the jQuery files and how they're organized; they sound like a good setup to follow. – Jonathan Jul 02 '10 at 04:20
  • Your welcome - I found the files in my custom UI package in the folder development-bundle -> themes -> no-theme – Marko Jul 02 '10 at 04:22
  • but @import is not advisable for performance http://developer.yahoo.com/performance/rules.html#csslink – Jitendra Vyas Jul 06 '10 at 13:17