Skip to content

Commit 987c303

Browse files
authored
transform minification #75 keyframe minification #74 current color handling #78
M1.0.0
2 parents efcb395 + 637a517 commit 987c303

File tree

177 files changed

+9494
-4374
lines changed

Some content is hidden

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

177 files changed

+9494
-4374
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
# v1.0.0
4+
5+
- [x] current color parse error when used in color functions
6+
- [x] minification : CSS transform module level 2
7+
- [x] translate
8+
- [x] scale
9+
- [x] rotate
10+
- [x] skew
11+
- [x] perspective
12+
- [x] matrix
13+
- [x] matrix3d
14+
- [x] keyframes
15+
- [x] remove consecutive keyframes with the same name
16+
- [x] reduce keyframe selector 'from' to '0%'
17+
- [x] reduce keyframe selector '100%' to 'to'
18+
- [x] remove keyframe selector ignored declarations
19+
- [x] merge keyframe rules and declarations
20+
- [x] trim extra space in declaration value 'url() 15%' -> 'url()15%', '1% !important' -> '1%!important'
21+
- [x] allow empty value for css variable declaration '--color: ;'
22+
- [x] change generate nesting rule default to true
23+
324
# v0.9.1
425

526
- [x] minification passes #66

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: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Writerside/c.list

Lines changed: 0 additions & 6 deletions
This file was deleted.

Writerside/cfg/buildprofiles.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

Writerside/in.tree

Lines changed: 0 additions & 14 deletions
This file was deleted.

Writerside/topics/Reference.topic

Lines changed: 0 additions & 45 deletions
This file was deleted.

Writerside/v.list

Lines changed: 0 additions & 5 deletions
This file was deleted.

Writerside/writerside.cfg

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)