Locomotive's Front-end Boilerplate ================================== Front-end boilerplate for projects by [Locomotive][locomtl]. ## Requirements | Prerequisite | How to check | How to install | | --------------- | ------------- | -------------------------------- | | Node.js 4.1.1 | `node -v` | [nodejs.org](https://nodejs.org) | | Grunt >= 0.1.13 | `grunt -v` | `npm install -g grunt-cli` | ## Getting started 1. **Get the latest node modules** - `npm install -g npm-check-updates` - `npm-check-updates -u` - `npm install` BrowserSync will automatically inject, refresh and sync all your browsers. 2. **Set your project** - `build/browserSync.js` update proxy - `assets/scripts/utils/environment.js` update `APP_NAME` 3. **Run grunt, BrowserSync and start coding** - `grunt sync` ### Grunt Each Grunt task has it's own file in the `grunt_tasks` folder. ## CSS - We use [Sass](http://sass-lang.com) for our CSS Preprocessor - [itcss](http://itcss.io) CSS architecture - More Minimal BEM like CSS Syntax: `.block_element -modifier` - [More Transparent UI Code with Namespaces](http://csswizardry.com/2015/03/more-transparent-ui-code-with-namespaces) ### Sass import order * **Settings:** Global variables, site-wide settings, config switches, etc. * **Tools:** Site-wide mixins and functions. * **Generic:** Low-specificity, far-reaching rulesets (e.g. resets). * **Base:** Unclassed HTML elements (e.g. `a {}`, `blockquote {}`, `address {}`). * **Objects:** Objects, abstractions, and design patterns (e.g. `.o-media {}`). * **Components:** Discrete, complete chunks of UI (e.g. `.c-carousel {}`). * **Utilities:** High-specificity, very explicit selectors. Overrides and helper classes (e.g. `.u-hidden {}`). ### Grid We use [inuitcss](https://github.com/inuitcss/inuitcss/tree/6eb574fa604481ffa36272e6034e77467334ec50) layout and width system. We are using a inline-block grid system. Insert a `.o-layout` block and add `.o-layout_item` elements inside it. By default `o-layout_item` made 100%. You can define different fractions in `/tools/_widths.scss` (`$widths-fractions`) If you want a 2 columns grid, just add `.u-1/2` on your 2 `.o-layout_item` If you want to adapt columns by media queries, by example a 2 columns grid for 1000px + resolutions, and one columns in block under 1000px : **HTML** ```