Created
June 28, 2016 14:11
-
-
Save mlabod/812357300fee4d897b6c8eeb052b1a41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**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