Skip to content

Commit 69d47b8

Browse files
authored
Merge pull request #77 from tbela99/feature/transform
minify transform functions #75
2 parents 9135d3b + 87550ac commit 69d47b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+6097
-2041
lines changed

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
# Changelog
22

3-
# v0.9.2
4-
3+
# v1.0.0
4+
5+
- [x] experimental minification : CSS transform module level 2
6+
- [x] translate
7+
- [x] scale
8+
- [x] rotate
9+
- [x] skew
10+
- [x] perspective
11+
- [x] matrix
12+
- [x] matrix3d
513
- [x] keyframes
614
- [x] remove consecutive keyframes with the same name
715
- [x] reduce keyframe selector 'from' to '0%'

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Thierry Bela
3+
Copyright (c) 2023-present Thierry Bela
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ $ deno add @tbela99/css-parser
3434
- convert nested css rules to legacy syntax
3535
- generate sourcemap
3636
- compute css shorthands. see supported properties list below
37+
- experimental minification : css transform module level 2
3738
- evaluate math functions: calc(), clamp(), min(), max(), round(), mod(), rem(), sin(), cos(), tan(), asin(), acos(),
3839
atan(), atan2(), pow(), sqrt(), hypot(), log(), exp(), abs(), sign()
3940
- inline css variables
@@ -96,7 +97,7 @@ Javascript module from cdn
9697

9798
<script type="module">
9899
99-
import {transform} from 'https://esm.sh/@tbela99/css-parser@0.9.0/web';
100+
import {transform} from 'https://esm.sh/@tbela99/css-parser@1.0.0/web';
100101
101102
102103
const css = `
@@ -159,6 +160,7 @@ Include ParseOptions and RenderOptions
159160
- expandNestingRules: boolean, optional. convert nesting rules into separate rules. will automatically set nestingRules
160161
to false.
161162
- removeDuplicateDeclarations: boolean, optional. remove duplicate declarations.
163+
- computeTransform: boolean, optional. compute css transform functions.
162164
- computeShorthand: boolean, optional. compute shorthand properties.
163165
- computeCalcExpression: boolean, optional. evaluate calc() expression
164166
- inlineCssVariables: boolean, optional. replace some css variables with their actual value. they must be declared once
@@ -176,13 +178,18 @@ Include ParseOptions and RenderOptions
176178
- src: string, optional. original css file location to be used with sourcemap, also used to resolve url().
177179
- sourcemap: boolean, optional. preserve node location data.
178180

179-
> Misc Options
181+
> Ast Traversal Options
182+
183+
- visitor: VisitorNodeMap, optional. node visitor used to transform the ast.
184+
185+
> Urls and \@import Options
180186
187+
- resolveImport: boolean, optional. replace @import rule by the content of the referenced stylesheet.
181188
- 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.
189+
190+
> Misc Options
183191
- removeCharset: boolean, optional. remove @charset.
184192
- cwd: string, optional. destination directory used to resolve url().
185-
- visitor: VisitorNodeMap, optional. node visitor used to transform the ast.
186193
- signal: AbortSignal, optional. abort parsing.
187194

188195
#### RenderOptions
@@ -701,6 +708,8 @@ for (const {node, parent, root} of walk(ast)) {
701708

702709
## Minification
703710

711+
- [x] minify keyframs
712+
- [x] minify transform
704713
- [x] evaluate math functions calc(), clamp(), min(), max(), round(), mod(), rem(), sin(), cos(), tan(), asin(),
705714
acos(), atan(), atan2(), pow(), sqrt(), hypot(), log(), exp(), abs(), sign()
706715
- [x] multi-pass minification

0 commit comments

Comments
 (0)