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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.0299latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.0299
1.0.413
1.0.30
1.0.20
1.0.10
1.0.00
0.0.31
0.0.20
0.0.10

Package Sidebar

Install

npm i postcss-remove-classes

Weekly Downloads

313

Version

2.0.0

License

ISC

Unpacked Size

11.5 kB

Total Files

9

Last publish

Collaborators

  • jacobp100