suitnames
suitnames is a simple utility to manage CSS modules with SUIT CSS -like naming conventions on React.
Shamefully based on bem-classnames, which is in turn inspired by classnames.
npm install suitnames
Usage
var styles = ;var sx = ;;
Simple
Attention: classes would be added only if they are exported from cssmodules
style, otherwise they would be skipped.
Works best with localIdentName=[name]-[local]
.
var styles = ;var sx = ;; // "Button-Button Button--color-green Button--block"; // "Button--disabled"; // "Button-a Button-b Button-c Button-d"
Custom prefix
// Default prefixes://// sx.settings = {// prefix: '-',// separator: '-'// };sxsettingsprefix = '_';sxsettingsseparator = '---';; // => styles['_flat']; // => styles['_country---gb']