@tbela99/css-parser 1.5.0 → 1.6.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/CHANGELOG.md +59 -0
- package/README.md +10 -10
- package/dist/index-umd-web.js +5998 -4972
- package/dist/index.cjs +6001 -4977
- package/dist/index.d.ts +52 -38
- package/dist/lib/ast/expand.js +21 -7
- package/dist/lib/ast/features/calc.js +17 -55
- package/dist/lib/ast/features/if.js +7 -3
- package/dist/lib/ast/features/inlinecssvariables.js +6 -5
- package/dist/lib/ast/features/prefix.js +41 -44
- package/dist/lib/ast/features/shorthand.js +10 -5
- package/dist/lib/ast/features/transform.js +2 -2
- package/dist/lib/ast/math/expression.js +207 -34
- package/dist/lib/ast/minify.js +121 -24
- package/dist/lib/ast/node.js +5 -3
- package/dist/lib/ast/transform/compute.js +37 -5
- package/dist/lib/ast/transform/minify.js +7 -7
- package/dist/lib/ast/transform/perspective.js +1 -1
- package/dist/lib/ast/transform/rotate.js +1 -1
- package/dist/lib/ast/transform/scale.js +1 -1
- package/dist/lib/ast/transform/skew.js +1 -1
- package/dist/lib/ast/transform/translate.js +1 -1
- package/dist/lib/ast/transform/utils.js +46 -18
- package/dist/lib/ast/walk.js +28 -4
- package/dist/{config.json.js → lib/data/properties.json.js} +106 -0
- package/dist/lib/{validation/config.json.js → data/validation.json.js} +14 -8
- package/dist/lib/fs/resolve.js +11 -2
- package/dist/lib/parser/declaration/list.js +22 -7
- package/dist/lib/parser/declaration/map.js +26 -8
- package/dist/lib/parser/declaration/set.js +3 -1
- package/dist/lib/parser/linesmap.js +2 -4
- package/dist/lib/parser/parse.js +393 -231
- package/dist/lib/parser/tokenize.js +1478 -819
- package/dist/lib/parser/utils/at-rule-container.js +28 -196
- package/dist/lib/parser/utils/at-rule-generic.js +6 -7
- package/dist/lib/parser/utils/at-rule-import.js +17 -13
- package/dist/lib/parser/utils/at-rule-media.js +36 -19
- package/dist/lib/parser/utils/at-rule-support.js +19 -9
- package/dist/lib/parser/utils/at-rule-when-else.js +11 -38
- package/dist/lib/parser/utils/at-rule.js +0 -18
- package/dist/lib/parser/utils/config.js +1 -1
- package/dist/lib/parser/utils/declaration.js +40 -97
- package/dist/lib/parser/utils/hash.js +4 -4
- package/dist/lib/parser/utils/selector.js +179 -224
- package/dist/lib/parser/utils/text.js +4 -2
- package/dist/lib/renderer/render.js +104 -74
- package/dist/lib/renderer/sourcemap/lib/codec.js +3 -3
- package/dist/lib/renderer/sourcemap/sourcemap.js +2 -5
- package/dist/lib/syntax/color/a98rgb.js +14 -4
- package/dist/lib/syntax/color/cmyk.js +14 -21
- package/dist/lib/syntax/color/color-mix.js +21 -34
- package/dist/lib/syntax/color/color.js +32 -49
- package/dist/lib/syntax/color/hsl.js +15 -15
- package/dist/lib/syntax/color/hwb.js +18 -17
- package/dist/lib/syntax/color/lab.js +17 -17
- package/dist/lib/syntax/color/lch.js +13 -13
- package/dist/lib/syntax/color/oklab.js +10 -11
- package/dist/lib/syntax/color/oklch.js +15 -18
- package/dist/lib/syntax/color/p3.js +18 -12
- package/dist/lib/syntax/color/prophotorgb.js +26 -28
- package/dist/lib/syntax/color/rec2020.js +8 -4
- package/dist/lib/syntax/color/relative-color.js +26 -10
- package/dist/lib/syntax/color/srgb.js +9 -7
- package/dist/lib/syntax/color/utils/distance.js +1 -1
- package/dist/lib/syntax/color/xyz.js +2 -2
- package/dist/lib/syntax/color/xyzd50.js +2 -2
- package/dist/lib/syntax/constants.js +13 -3
- package/dist/lib/syntax/syntax.js +32 -108
- package/dist/lib/validation/config.js +1 -1
- package/dist/lib/validation/match.js +29 -26
- package/dist/lib/validation/parser/parse.js +7 -3
- package/dist/node.js +16 -9
- package/dist/types.d.ts +5 -1
- package/dist/types.js +4 -0
- package/dist/utils/sync.js +22 -1
- package/dist/web.js +13 -4
- package/package.json +4 -4
- package/llms.txt +0 -80
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
# v1.6.1
|
|
4
|
+
|
|
5
|
+
- [x] fix bugs when computing math functions.
|
|
6
|
+
- [x] reduce array mutations
|
|
7
|
+
- [x] supporting additional shorthands: scroll-timeline, scroll-padding, scroll-margin.
|
|
8
|
+
- [x] do not minify transform function when the absolute angle is greater or equals to 360deg
|
|
9
|
+
|
|
10
|
+
```css
|
|
11
|
+
|
|
12
|
+
a:hover {
|
|
13
|
+
|
|
14
|
+
transform: rotate(calc(2.5*pi * 1rad)) }
|
|
15
|
+
.now {
|
|
16
|
+
transform: translate(100px, 100px) rotate(1215deg) skewX(10deg);
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
should be minified to
|
|
20
|
+
```css
|
|
21
|
+
a:hover {
|
|
22
|
+
transform: rotate(450deg)
|
|
23
|
+
}
|
|
24
|
+
.now {
|
|
25
|
+
transform: translate(100px,100px)rotate(1215deg)skew(10deg)
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
# v1.6.0
|
|
30
|
+
|
|
31
|
+
- [x] added support for math function `tan()`.
|
|
32
|
+
|
|
33
|
+
## Improvements
|
|
34
|
+
- [x] faster tokenizer
|
|
35
|
+
- [x] ensure transform: rotate(360deg) is not minified to transform: none
|
|
36
|
+
- [x] support input sourcemap from inline sourcemap file. This is only supported by the async parser.
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
|
|
40
|
+
table.colortable {
|
|
41
|
+
width: 100%;
|
|
42
|
+
text-shadow: none;
|
|
43
|
+
border-collapse: collapse
|
|
44
|
+
}
|
|
45
|
+
table.colortable td {
|
|
46
|
+
text-align: center
|
|
47
|
+
}
|
|
48
|
+
table.colortable td.c {
|
|
49
|
+
text-transform: uppercase;
|
|
50
|
+
background: #ff0
|
|
51
|
+
}
|
|
52
|
+
table.colortable th {
|
|
53
|
+
text-align: center;
|
|
54
|
+
color: green;
|
|
55
|
+
font-weight: 400;
|
|
56
|
+
padding: 2px 3px
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/*# sourceMappingURL=sourcemap.css.map */
|
|
60
|
+
```
|
|
61
|
+
|
|
3
62
|
# v1.5.0
|
|
4
63
|
|
|
5
64
|
## Improvements
|
package/README.md
CHANGED
|
@@ -99,6 +99,11 @@ Try it [online](https://tbela99.github.io/css-parser/playground/)
|
|
|
99
99
|
- typ: number
|
|
100
100
|
- val: string, the comment
|
|
101
101
|
|
|
102
|
+
### AtRuleStyleSheet
|
|
103
|
+
|
|
104
|
+
- typ: number
|
|
105
|
+
- chi: array of children
|
|
106
|
+
|
|
102
107
|
### Declaration
|
|
103
108
|
|
|
104
109
|
- typ: number
|
|
@@ -115,7 +120,7 @@ Try it [online](https://tbela99.github.io/css-parser/playground/)
|
|
|
115
120
|
- state: EnumAstNodeStatus, validation state
|
|
116
121
|
- errors: ErrorDescription[], validation errors
|
|
117
122
|
|
|
118
|
-
### AtRule
|
|
123
|
+
### AtRule and KeyframesAtRule
|
|
119
124
|
|
|
120
125
|
- typ: number
|
|
121
126
|
- nam: string. AtRule name
|
|
@@ -123,12 +128,7 @@ Try it [online](https://tbela99.github.io/css-parser/playground/)
|
|
|
123
128
|
- state: EnumAstNodeStatus, validation state
|
|
124
129
|
- errors: ErrorDescription[], validation errors
|
|
125
130
|
|
|
126
|
-
###
|
|
127
|
-
|
|
128
|
-
- typ: number
|
|
129
|
-
- chi: array of children
|
|
130
|
-
|
|
131
|
-
### KeyFrameRule
|
|
131
|
+
### KeyframesRule
|
|
132
132
|
|
|
133
133
|
- typ: number
|
|
134
134
|
- sel: string, css selector
|
|
@@ -185,9 +185,9 @@ Try it [online](https://tbela99.github.io/css-parser/playground/)
|
|
|
185
185
|
- [ ] place-content
|
|
186
186
|
- [ ] place-items
|
|
187
187
|
- [ ] place-self
|
|
188
|
-
- [
|
|
189
|
-
- [
|
|
190
|
-
- [
|
|
188
|
+
- [x] scroll-margin
|
|
189
|
+
- [x] scroll-padding
|
|
190
|
+
- [x] scroll-timeline
|
|
191
191
|
- [x] text-decoration
|
|
192
192
|
- [x] text-emphasis
|
|
193
193
|
- [x] transition
|