Tutorial :Lots of small CSS files or one big one with sections - from a code-quality standpoint



Question:

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?


Solution:1

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »