cssuniq
Library which makes all your CSS classes are unique.
Usage
var cssuniq = ; var classes = ; classes; // ".UNIQUEHASH-button {} .UNIQUEHASH-button-icon {}"classes; // Injects <style> tag with transformed style onto page; // "UNIQUEHASH-button"; // "UNIQUEHASH-button UNIQUEHASH-button-big"; // "UNIQUEHASH-button UNIQUEHASH-button-big"; // "UNIQUEHASH-button"; // "UNIQUEHASH-button UNIQUEHASH-button-big" var Button = React;
Pros & Cons
Pros
- Makes your components more reusable and independent.
- Disables CSS inheritance. Simulates shadow DOM.
Cons
- Impossible to quickly change classes style outside of the component.
TODO
- Webpack loader