postcss-remove-classes
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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 */

Package Sidebar

Install

npm i postcss-remove-classes

Weekly Downloads

2,316

Version

2.0.0

License

ISC

Unpacked Size

11.5 kB

Total Files

9

Last publish

Collaborators

  • jacobp100