- Maintainable OOCSS components
- Scalable code
- BEM - Block-element--modifier
- PascaleCase for component name
- camelCase for component childs
- Lowercase for modifiers
- Use
is-*
andhas-*
modifiers when needed
<div class="Component Component--modifier is-state">
<div class="Component-child"></div>
<div class="Component-otherChild"></div>
</div>
- Two spaces indent
- Space after
:
property declaration - Space before
{
rule declaration - Closing braces on a new line
.Component {
display: inline-block;
}
- Never use IDs
- No magic number
- Only use
!important
on utility classes - Max nesting level: 3
npm install
npm install -g gulp pug-cli backstopjs
gulp // starts server and watch files, available on localhost:3000
gulp icons // builds icons
Pre-commit hook ensures code has been linted.
npm run pre-commit
To bypass the pre-commit, just add -n
option.
git ci -n
git ci -nm "My commit message"
npm run release // builds, commits, push, tags, publishes to Bower and NPM and deploys to GitHub Pages
It can be run manually:
npm run deploy
Tests are run with Travis and have to be updated before branch merges. They can be run locally with these following commands.
npm run lint // linter
backstop reference // visual tests: builds references
backstop test // visual tests: compares references with actual HEAD