Skip to content

Instantly share code, notes, and snippets.

@mlabod
Created June 28, 2016 14:11
Show Gist options
  • Save mlabod/812357300fee4d897b6c8eeb052b1a41 to your computer and use it in GitHub Desktop.
Save mlabod/812357300fee4d897b6c8eeb052b1a41 to your computer and use it in GitHub Desktop.
**basic rules**
- Top level className in the stylus file == top level className in the component
- They live in the same folder
- camelCase everything
- Child elements start with top-level module name separated by a hyphen ,
no matter how deeply they are nested
- please only use hyphens for this
- modifiers can be named however, but should be used with chain selector `&.modifier`
**example**
``components/AddTask/taskItem.styl``
```css
.taskItem
..
.taskItem-body
..
.taskItem-date
...
&.modifier
```
``components/AddTask/TaskItem.js``
```javascript
const TaskItem = (
<div className="taskItem">
<div className="taskItem-body">
<div className="taskItem-date modifier"></div>
</div>
</div>
)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment