Skip to content

Commit

Permalink
Merge pull request airbnb#14 from airbnb/variable-naming
Browse files Browse the repository at this point in the history
Add section about using dash-cased for variable names
  • Loading branch information
lencioni committed Feb 22, 2016
2 parents 0c5513e + 14f444c commit 5bc0cbc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .scss-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ linters:
LeadingZero:
enabled: false

NameFormat:
enabled: true

PrivateNamingConvention:
enabled: true
prefix: _

PropertySortOrder:
enabled: false

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
1. [Sass](#sass)
- [Syntax](#syntax)
- [Ordering](#ordering-of-property-declarations)
- [Variables](#variables)
- [Mixins](#mixins)
- [Extend directive](#extend-directive)
- [Nested selectors](#nested-selectors)
Expand Down Expand Up @@ -240,6 +241,10 @@ Use `0` instead of `none` to specify that a style has no border.
}
```

### Variables

Prefer dash-cased variable names (e.g. `$my-variable`) over camelCased or snake_cased variable names. It is acceptable to prefix variable names that are intended to be used only within the same file with an underscore (e.g. `$_my-variable`).

### Mixins

Mixins should be used to DRY up your code, add clarity, or abstract complexity--in much the same way as well-named functions. Mixins that accept no arguments can be useful for this, but note that if you are not compressing your payload (e.g. gzip), this may contribute to unnecessary code duplication in the resulting styles.
Expand Down

0 comments on commit 5bc0cbc

Please sign in to comment.