Skip to content

Commit

Permalink
Add CSS-in-JavaScript section
Browse files Browse the repository at this point in the history
We have been writing CSS in JavaScript and have developed a set of best
practices around this type of thing. I thought it would be nice to
publish this document alongside our other JavaScript style guide
documents.
  • Loading branch information
lencioni committed Sep 1, 2016
1 parent 3a7210e commit 71a2b12
Show file tree
Hide file tree
Showing 2 changed files with 435 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Other Style Guides
- [ES5 (Deprecated)](https://github.com/airbnb/javascript/tree/es5-deprecated/es5)
- [React](react/)
- [CSS-in-JavaScript](css-in-javascript/)
- [CSS & Sass](https://github.com/airbnb/css)
- [Ruby](https://github.com/airbnb/ruby)

Expand Down Expand Up @@ -2218,7 +2219,7 @@ Other Style Guides
- [19.2](#commas--dangling) Additional trailing comma: **Yup.** eslint: [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle.html) jscs: [`requireTrailingComma`](http://jscs.info/rule/requireTrailingComma)

> Why? This leads to cleaner git diffs. Also, transpilers like Babel will remove the additional trailing comma in the transpiled code which means you don't have to worry about the [trailing comma problem](es5/README.md#commas) in legacy browsers.
```javascript
// bad - git diff without trailing comma
const hero = {
Expand Down
Loading

0 comments on commit 71a2b12

Please sign in to comment.