@tbela99/css-parser 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![playground](https://img.shields.io/badge/playground-try%20it%20now-%230a7398
2
2
  )](https://tbela99.github.io/css-parser/playground/) [![npm](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftbela99%2Fcss-parser%2Fmaster%2Fpackage.json&query=version&logo=npm&label=npm&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40tbela99%2Fcss-parser)](https://www.npmjs.com/package/@tbela99/css-parser) [![npm](https://img.shields.io/jsr/v/%40tbela99/css-parser?link=https%3A%2F%2Fjsr.io%2F%40tbela99%2Fcss-parser
3
- )](https://jsr.io/@tbela99/css-parser) [![cov](https://tbela99.github.io/css-parser/badges/coverage.svg)](https://github.com/tbela99/css-parser/actions) [![NPM Downloads](https://img.shields.io/npm/dm/%40tbela99%2Fcss-parser)](https://www.npmjs.com/package/@tbela99/css-parser)
3
+ )](https://jsr.io/@tbela99/css-parser) [![cov](https://tbela99.github.io/css-parser/badges/coverage.svg)](https://github.com/tbela99/css-parser/actions) [![NPM Downloads](https://img.shields.io/npm/dm/%40tbela99%2Fcss-parser)](https://www.npmjs.com/package/@tbela99/css-parser) [![bundle size](https://img.shields.io/bundlejs/size/%40tbela99/css-parser%400.9.0?exports=cjs)](https://www.npmjs.com/package/@tbela99/css-parser)
4
4
 
5
5
  # css-parser
6
6
 
@@ -65,7 +65,7 @@ import as a module
65
65
 
66
66
  ```javascript
67
67
 
68
- import {transform} from 'npm:@tbela99/css-parser';
68
+ import {transform} from '@tbela99/css-parser';
69
69
 
70
70
  // ...
71
71
  ```
@@ -96,7 +96,7 @@ Javascript module from cdn
96
96
 
97
97
  <script type="module">
98
98
 
99
- import {transform} from 'https://esm.sh/@tbela99/css-parser@0.4.0/web';
99
+ import {transform} from 'https://esm.sh/@tbela99/css-parser@0.9.0/web';
100
100
 
101
101
 
102
102
  const css = `
@@ -154,6 +154,7 @@ Include ParseOptions and RenderOptions
154
154
  > Minify Options
155
155
 
156
156
  - minify: boolean, optional. default to _true_. optimize ast.
157
+ - pass: number, optional. minification pass. default to 1
157
158
  - nestingRules: boolean, optional. automatically generated nested rules.
158
159
  - expandNestingRules: boolean, optional. convert nesting rules into separate rules. will automatically set nestingRules
159
160
  to false.
@@ -700,7 +701,9 @@ for (const {node, parent, root} of walk(ast)) {
700
701
 
701
702
  ## Minification
702
703
 
703
- - [x] reduce calc()
704
+ - [x] evaluate math functions calc(), clamp(), min(), max(), round(), mod(), rem(), sin(), cos(), tan(), asin(),
705
+ acos(), atan(), atan2(), pow(), sqrt(), hypot(), log(), exp(), abs(), sign()
706
+ - [x] multi-pass minification
704
707
  - [x] inline css variables
705
708
  - [x] merge identical rules
706
709
  - [x] merge adjacent rules
@@ -816,7 +819,7 @@ the visitor is called only on 'height' declarations
816
819
  ```typescript
817
820
 
818
821
  import {AstDeclaration, LengthToken, ParserOptions} from "../src/@types";
819
- import {EnumToken, EnumToken} from "../src/lib";
822
+ import {EnumToken} from "../src/lib";
820
823
  import {transform} from "../src/node";
821
824
 
822
825
  const options: ParserOptions = {