prc

postcss-remove-classes

PostCSS plugin to remove specific classes from a CSS file

Showing:

Popularity

Downloads/wk

75

GitHub Stars

9

Maintenance

Last Commit

5yrs ago

Contributors

1

Package

Dependencies

3

Size (min+gzip)

57.0KB

License

ISC

Type Definitions

Tree-Shakeable

Yes?

Categories

Readme

postcss-remove-classes

Removes all instances of one or more class selectors from a CSS file. Accepts one argument that specifies which class names must be removed. This must be a single string, an array of strings, or a RegExp instance.

npm i --save-dev postcss-remove-classes
postcss()
  .use(plugin(['remove'])) // Add as many as you like
  .process('.remove {} .keep {}').css // Gives .keep {}

Examples

a:matches(.remove) /* empty */
a:matches(.remove, .keep) /* a:matches(.keep) */
a:not(.remove) /* a */
a:not(.remove, .keep) /* a:not(.keep) */
a[class="remove"] /* a[class="remove"] --- Will not look in attributes */

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100