@@ -27,15 +27,14 @@ $ deno add @tbela99/css-parser
2727- fault-tolerant parser, will try to fix invalid tokens according to the CSS syntax module 3 recommendations.
2828- fast and efficient minification without unsafe transforms,
2929 see [ benchmark] ( https://tbela99.github.io/css-parser/benchmark/index.html )
30- - minify colors.
31- - support css color level 4 & 5: color(), lab(), lch(), oklab(), oklch(), color-mix(), light-dark(), system colors and
30+ - minify colors: color(), lab(), lch(), oklab(), oklch(), color-mix(), light-dark(), system colors and
3231 relative color
3332- generate nested css rules
3433- convert nested css rules to legacy syntax
3534- generate sourcemap
3635- compute css shorthands. see supported properties list below
37- - evaluate math functions: calc(), clamp(), min(), max(), round(), mod(), rem(), sin(), cos(), tan(), asin(), acos(),
38- atan(), atan2(), pow (), sqrt (), hypot (), log (), exp(), abs(), sign()
36+ - css transform functions minification
37+ - evaluate math functions: calc (), clamp (), min (), max (), etc.
3938- inline css variables
4039- remove duplicate properties
4140- flatten @import rules
@@ -96,7 +95,7 @@ Javascript module from cdn
9695
9796<script type =" module" >
9897
99- import {transform } from ' https://esm.sh/@tbela99/css-parser@0.9 .0/web' ;
98+ import {transform } from ' https://esm.sh/@tbela99/css-parser@1.0 .0/web' ;
10099
101100
102101 const css = `
@@ -159,6 +158,7 @@ Include ParseOptions and RenderOptions
159158- expandNestingRules: boolean, optional. convert nesting rules into separate rules. will automatically set nestingRules
160159 to false.
161160- removeDuplicateDeclarations: boolean, optional. remove duplicate declarations.
161+ - computeTransform: boolean, optional. compute css transform functions.
162162- computeShorthand: boolean, optional. compute shorthand properties.
163163- computeCalcExpression: boolean, optional. evaluate calc() expression
164164- inlineCssVariables: boolean, optional. replace some css variables with their actual value. they must be declared once
@@ -176,13 +176,18 @@ Include ParseOptions and RenderOptions
176176- src: string, optional. original css file location to be used with sourcemap, also used to resolve url().
177177- sourcemap: boolean, optional. preserve node location data.
178178
179- > Misc Options
179+ > Ast Traversal Options
180+
181+ - visitor: VisitorNodeMap, optional. node visitor used to transform the ast.
182+
183+ > Urls and \@ import Options
180184
185+ - resolveImport: boolean, optional. replace @import rule by the content of the referenced stylesheet.
181186- resolveUrls: boolean, optional. resolve css 'url()' according to the parameters 'src' and 'cwd'
182- - resolveImport: boolean, optional. replace @import rule by the content of its referenced stylesheet.
187+
188+ > Misc Options
183189- removeCharset: boolean, optional. remove @charset .
184190- cwd: string, optional. destination directory used to resolve url().
185- - visitor: VisitorNodeMap, optional. node visitor used to transform the ast.
186191- signal: AbortSignal, optional. abort parsing.
187192
188193#### RenderOptions
@@ -701,6 +706,8 @@ for (const {node, parent, root} of walk(ast)) {
701706
702707## Minification
703708
709+ - [x] minify keyframs
710+ - [x] minify transform
704711- [x] evaluate math functions calc(), clamp(), min(), max(), round(), mod(), rem(), sin(), cos(), tan(), asin(),
705712 acos(), atan(), atan2(), pow(), sqrt(), hypot(), log(), exp(), abs(), sign()
706713- [x] multi-pass minification
0 commit comments