开发者

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

开发者 https://www.devze.com 2023-01-05 16:54 出处:网络
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

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 disti开发者_如何学Pythonnct sections through comments?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消