@tbela99/css-parser 1.5.0 → 1.6.0

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +7 -7
  3. package/dist/index-umd-web.js +5562 -4731
  4. package/dist/index.cjs +5565 -4736
  5. package/dist/index.d.ts +51 -37
  6. package/dist/lib/ast/expand.js +21 -7
  7. package/dist/lib/ast/features/calc.js +17 -55
  8. package/dist/lib/ast/features/if.js +7 -3
  9. package/dist/lib/ast/features/inlinecssvariables.js +6 -5
  10. package/dist/lib/ast/features/prefix.js +41 -44
  11. package/dist/lib/ast/features/shorthand.js +10 -5
  12. package/dist/lib/ast/features/transform.js +1 -1
  13. package/dist/lib/ast/math/expression.js +190 -32
  14. package/dist/lib/ast/minify.js +37 -14
  15. package/dist/lib/ast/node.js +5 -3
  16. package/dist/lib/ast/transform/compute.js +63 -4
  17. package/dist/lib/ast/transform/minify.js +6 -6
  18. package/dist/lib/ast/transform/perspective.js +1 -1
  19. package/dist/lib/ast/transform/rotate.js +1 -1
  20. package/dist/lib/ast/transform/scale.js +1 -1
  21. package/dist/lib/ast/transform/skew.js +1 -1
  22. package/dist/lib/ast/transform/translate.js +1 -1
  23. package/dist/lib/ast/transform/utils.js +46 -18
  24. package/dist/lib/ast/walk.js +28 -4
  25. package/dist/lib/fs/resolve.js +11 -2
  26. package/dist/lib/parser/declaration/list.js +22 -7
  27. package/dist/lib/parser/declaration/map.js +26 -8
  28. package/dist/lib/parser/declaration/set.js +3 -1
  29. package/dist/lib/parser/linesmap.js +2 -4
  30. package/dist/lib/parser/parse.js +388 -227
  31. package/dist/lib/parser/tokenize.js +1478 -818
  32. package/dist/lib/parser/utils/at-rule-container.js +28 -196
  33. package/dist/lib/parser/utils/at-rule-generic.js +6 -7
  34. package/dist/lib/parser/utils/at-rule-import.js +17 -13
  35. package/dist/lib/parser/utils/at-rule-media.js +36 -19
  36. package/dist/lib/parser/utils/at-rule-support.js +19 -9
  37. package/dist/lib/parser/utils/at-rule-when-else.js +11 -38
  38. package/dist/lib/parser/utils/at-rule.js +0 -18
  39. package/dist/lib/parser/utils/declaration.js +30 -95
  40. package/dist/lib/parser/utils/hash.js +4 -4
  41. package/dist/lib/parser/utils/selector.js +89 -144
  42. package/dist/lib/parser/utils/text.js +4 -2
  43. package/dist/lib/renderer/render.js +102 -72
  44. package/dist/lib/renderer/sourcemap/sourcemap.js +2 -5
  45. package/dist/lib/syntax/color/a98rgb.js +14 -4
  46. package/dist/lib/syntax/color/cmyk.js +10 -18
  47. package/dist/lib/syntax/color/color-mix.js +21 -34
  48. package/dist/lib/syntax/color/color.js +32 -49
  49. package/dist/lib/syntax/color/hsl.js +15 -15
  50. package/dist/lib/syntax/color/hwb.js +18 -17
  51. package/dist/lib/syntax/color/lab.js +17 -17
  52. package/dist/lib/syntax/color/lch.js +13 -13
  53. package/dist/lib/syntax/color/oklab.js +10 -11
  54. package/dist/lib/syntax/color/oklch.js +15 -18
  55. package/dist/lib/syntax/color/p3.js +18 -12
  56. package/dist/lib/syntax/color/prophotorgb.js +26 -28
  57. package/dist/lib/syntax/color/rec2020.js +8 -4
  58. package/dist/lib/syntax/color/relative-color.js +26 -10
  59. package/dist/lib/syntax/color/srgb.js +5 -4
  60. package/dist/lib/syntax/color/utils/distance.js +1 -1
  61. package/dist/lib/syntax/color/xyz.js +2 -2
  62. package/dist/lib/syntax/color/xyzd50.js +2 -2
  63. package/dist/lib/syntax/constants.js +12 -2
  64. package/dist/lib/syntax/syntax.js +32 -108
  65. package/dist/lib/validation/config.json.js +3 -0
  66. package/dist/lib/validation/match.js +29 -26
  67. package/dist/node.js +16 -9
  68. package/dist/types.d.ts +5 -1
  69. package/dist/types.js +4 -0
  70. package/dist/utils/sync.js +22 -1
  71. package/dist/web.js +13 -4
  72. package/package.json +1 -1
  73. package/llms.txt +0 -80
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ # v1.6.0
4
+
5
+ - [x] added support for math function `tan()`.
6
+
7
+ ## Improvements
8
+ - [x] faster tokenizer
9
+ - [x] ensure transform: rotate(360deg) is not minified to transform: none
10
+ - [x] support input sourcemap from inline sourcemap file. This is only supported by the async parser.
11
+
12
+ ```css
13
+
14
+ table.colortable {
15
+ width: 100%;
16
+ text-shadow: none;
17
+ border-collapse: collapse
18
+ }
19
+ table.colortable td {
20
+ text-align: center
21
+ }
22
+ table.colortable td.c {
23
+ text-transform: uppercase;
24
+ background: #ff0
25
+ }
26
+ table.colortable th {
27
+ text-align: center;
28
+ color: green;
29
+ font-weight: 400;
30
+ padding: 2px 3px
31
+ }
32
+
33
+ /*# sourceMappingURL=sourcemap.css.map */
34
+ ```
35
+
3
36
  # v1.5.0
4
37
 
5
38
  ## 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
- ### AtRuleStyleSheet
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