next-postcss-bem

1.0.0 • Public • Published

Next PostCSS Bem Build Status

[NextPostCSS] plugin implementing BEM as at-rules.

@utility utilityName {
    color: green;
}

@utility utilityName small {
    color: blue;
}

@component ComponentName {
    color: cyan;

    @modifier modifierName {
        color: yellow;
    }

    @descendent descendentName {
        color: navy;
    }

    @when stateName {
        color: crimson;
    }
}

@component-namespace nmsp {
    @component ComponentName {
        color: red;
    }
}
.u-utilityName {
    color: green;
}

.u-sm-utilityName {
    color: blue;
}

.ComponentName {
    color: cyan;
}

.ComponentName--modifierName {
    color: yellow;
}

.ComponentName-descendentName {
    color: navy;
}

.ComponentName.is-stateName {
    color: crimson;
}

.nmsp-ComponentName {
    color: red;
}

Usage

postcss([ require('next-postcss-bem')({
    defaultNamespace: undefined, // default namespace to use, none by default
    style: 'suit' // suit or bem, suit by default
}) ])

See PostCSS docs for examples for your environment.

Package Sidebar

Install

npm i next-postcss-bem

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

123 kB

Total Files

7

Last publish

Collaborators

  • issa