|
1 | 1 | [](https://tbela99.github.io/css-parser/playground/) [](https://www.npmjs.com/package/@tbela99/css-parser) [](https://jsr.io/@tbela99/css-parser) [](https://github.com/tbela99/css-parser/actions) [](https://www.npmjs.com/package/@tbela99/css-parser) |
| 3 | +)](https://jsr.io/@tbela99/css-parser) [](https://github.com/tbela99/css-parser/actions) [](https://www.npmjs.com/package/@tbela99/css-parser) [](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 = { |
|
0 commit comments