PostCSS Class Patterns
PostCSS plugin to match class patterns (prefix, suffix, contains) in a SAFE way. This is achieved by combining different attribute selectors with all possible class delimiters (spaces, tabs, line feed, form feed, carriage return). This plugin is inspired by this post and follows the HTML5 Spec
Supports the pseudo-classes :class-starts-with()
, :class-ends-with()
and :class-contains()
.
/* input */) /* output */[',
which matches
matchedmatchednot matched
/* input */) /* output */',
/* input */) /* output */
Usage
See PostCSS docs for examples for your environment.