Class Name Builder
Simple class for building BEM class names from css modules.
Usage
SCSS
.Modal
JS
Please note that the constructor has a new option available. Providing true
as the third argument will result in generating two classes instead of one
when fetching for element with modifier. Please see headerLarge
example.
;; const c = style 'Modal';const cExtended = style 'Modal' true; const base = c; // returns `Modal`const header = c; // returns `Modal__header`const small = c; // returns `Modal--small'const headerLarge = cExtended; // returns `Modal__header Modal__header--large`const headerLargeWithoutElement = c; // returns `Modal__header--large`const nonExistent = c; // returns `` (empty string)