https://github.com/localvoid/clsmin
CSS Class Name Minifier
https://github.com/localvoid/clsmin
css minifier
Last synced: about 1 year ago
JSON representation
CSS Class Name Minifier
- Host: GitHub
- URL: https://github.com/localvoid/clsmin
- Owner: localvoid
- License: mit
- Created: 2017-07-13T10:40:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-08T05:10:30.000Z (over 8 years ago)
- Last Synced: 2024-04-29T19:42:21.447Z (almost 2 years ago)
- Topics: css, minifier
- Language: TypeScript
- Size: 49.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSS Class Name Minifier
## Usage Example
```ts
import { clsmin, easyListFilter } from "clsmin";
const minifier = clsmin(
(className) => (
!className.toLowerCase().startsWith("ad") &&
easyListFilter(className)
);
);
minifier("header");
// => a
minifier("footer");
// => b
minifier("header");
// => a
```
## API
### Class Name Minifier
```ts
clsmin(filter: (className: string) => boolean = () => true): (className: string) => string;
```
### EasyList
Class names blocked by adblocking software.
```ts
const EasyListClassNames: Set;
function easyListFilter(className: string): boolean;
```
## ChangeLog
### 1.0.0
- Filter interface is now compatible with `Array.prototype.filter()` method.