class-ic
Automatic injection of css Classes In Components through props.
Getting Started
The 2.0 (organized) version is here. I've started to clean repo and create examples. :-)
Installing
npm install --save class-ic
Using
Style your components using BEM methodology with helper mixins:
} // the second param is the prop name } // you can group modifiers in a prop, passing true to second param } } } }}
Create your React component, import your sass through css-modules and create a Classic Component:
;; ; { return <div classicBlock> <p classicElement="text">thispropschildren</p> </div> ; } Button styles;
When you will use your new created component:
<Button ="danger"> My Class-ic Button</Button>
Structure
The api above create a component that accept this props:
- large (boolean);
- color (one of "success", "warning", "danger")
And the component itself has:
- block (.button)
- element (.text)
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Marcelo Junior - marceloadsj
License
This project is licensed under the MIT License - see the LICENSE file for details
Acknowledgments
Inspired by: