7 ms·
Any reason it's all contained in one file instead of broken up?
by lucisferre 14y ago
Any reason it's all contained in one file instead of broken up?
- youngtaff 14y agoWhy would you want to break it up?
- csswizardry 14y agoFor a framework it might be a nicer option, so that you can drop a module by only deleting the include reference rather than permanently deleting dozens of lines. Perhaps. It’s largely down to taste I imagine :)
- jeremyworboys 14y agoI recently used a bastardisation of v3 and v4 (I was using v3 then you released v4) and I split each object into separate files and left the imports commented out in the main.scss file. I then uncommented each object as I used it so I didn't reach the end of the project with unused objects in the CSS and not being able to remember whether or not I had actually used them. I did a similar thing with the grid module: commented out all sizes and uncommented what I used as I went.
- lucisferre 14y agoAs far as I'm concerned CSS is no different than any other code and should be separated into modules so it's easier to read and understand. This is especially true if you're using something like SCSS. This SMACSS book recommends this and frameworks like Bootstrap and Foundation pretty much follow that approach.
- csswizardry 14y agoI personally like working that way, but I think I might split it out so that dropping an object only takes deleting one line from a file and not dozens :)
- lucisferre 14y agoMore importantly when people contribute or wish to extend the project they can do so by adding a new module file instead of editing the existing code. Open closed principle. Also if people are importing using SMACSS they can also select individual modules to import if they prefer that to importing everything.
- csswizardry 14y agoBroken it up! Thanks :) https://github.com/csswizardry/inuit.css/blob/master/inuit.css/inuit.scss https://github.com/csswizardry/inuit.css/blob/master/inuit.c...