csswizardry/inuit.css — pull request #131 by BPScott (2013-02-03 22:27:15+00:00)
Title: Ideas for improving usage as a library / submodule

This is a pull request to demonstrate a pair of suggestions that I believe would make Inuit more usable as a submodule: Adding default variables as part of Inuit's core and adding folder-based includes. I wrote some thoughts on this in #108 and here is the end result.

**Default variables** add robustness to Inuit and means that an end-user only has to define the specific variables they want to override prior to `@import`ing Inuit, instead of having to define every variable. It also means that the Inuit library (i.e. just the inuit.css folder) can compile cleanly on it's own without any external dependancies (aside from sass, of course). In my opinion this is key to @csswizardry's idea of separating Inuit into a library and template repo as it means the dependency graph between these two repos is trivial (i.e. the template depends upon the library). Without this, the Inuit library is unable to compile on it's own so you end up with a circular dependency (i.e. the template depends upon the library, which in turn depends up on the template for it's variables to be set) which is unneeded coupling in my opinion.

**Folder-based imports** assists advanced users who want a customized build of Inuit by removing some of the repetition when `@import`ing files. It does this by creating importable files that reflect the folder naming convention, so that if an end-user wants to include everything in the "generic" folder then they can `@import 'inuit.css/generic'` instead of `@import`ing every file within that folder. This approach is also taken by [Compass](https://github.com/chriseppstein/compass/tree/stable/frameworks/compass/stylesheets/compass). The [compass-inuit](https://github.com/stephenway/compass-inuit/tree/master/stylesheets/compass-inuit) extension has also created these files to aid in importing, which suggests that this would be a useful addition to Inuit's core library.

I have created [a repo](https://github.com/BPScott/inuitcss-lib-demo) demonstrating a potential layout for what a template repository could look like, including Inuit included as a git submodule (though it could quite easily be a downloaded and extracted zip file) and [trivial](https://github.com/BPScott/inuitcss-lib-demo/blob/master/assets/stylesheets/basic.scss), [simple](https://github.com/BPScott/inuitcss-lib-demo/blob/master/assets/stylesheets/kitchen-sink.scss) and [advanced](https://github.com/BPScott/inuitcss-lib-demo/blob/master/assets/stylesheets/cherry-pick.scss) usage of Inuit as a library, using the changes included in this branch to demonstrate syntax.

/cc @stephenway as these changes that could ease compass-inuit's integration process