@stylexjs/shared 0.2.0-beta.21 → 0.2.0-beta.22
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/convert-to-className.js +6 -6
- package/lib/generate-css-rule.js +3 -3
- package/lib/hash.js +10 -11
- package/lib/index.d.ts +4 -4
- package/lib/index.js +12 -21
- package/lib/index.js.flow +4 -4
- package/lib/messages.d.ts +2 -1
- package/lib/messages.js +29 -54
- package/lib/messages.js.flow +2 -1
- package/lib/physical-rtl/generate-ltr.js +39 -39
- package/lib/physical-rtl/generate-rtl.js +57 -57
- package/lib/preprocess-rules/PreRule.js +2 -2
- package/lib/preprocess-rules/application-order.d.ts +36 -8
- package/lib/preprocess-rules/application-order.js +149 -164
- package/lib/preprocess-rules/application-order.js.flow +35 -7
- package/lib/preprocess-rules/basic-validation.js +6 -6
- package/lib/preprocess-rules/flatten-raw-style-obj.js +10 -10
- package/lib/preprocess-rules/index.js +6 -6
- package/lib/preprocess-rules/legacy-expand-shorthands.d.ts +22 -2
- package/lib/preprocess-rules/legacy-expand-shorthands.js +81 -65
- package/lib/preprocess-rules/legacy-expand-shorthands.js.flow +22 -2
- package/lib/preprocess-rules/property-specificity.d.ts +29 -25
- package/lib/preprocess-rules/property-specificity.js +63 -75
- package/lib/preprocess-rules/property-specificity.js.flow +28 -24
- package/lib/properties/CSS Animations.json +445 -0
- package/lib/properties/CSS Backgrounds and Borders.json +1085 -0
- package/lib/properties/CSS Basic User Interface.json +365 -0
- package/lib/properties/CSS Box Alignment.json +245 -0
- package/lib/properties/CSS Box Model.json +501 -0
- package/lib/properties/CSS Color.json +100 -0
- package/lib/properties/CSS Columns.json +185 -0
- package/lib/properties/CSS Containment.json +203 -0
- package/lib/properties/CSS Counter Styles.json +56 -0
- package/lib/properties/CSS Display.json +20 -0
- package/lib/properties/CSS Flexible Box Layout.json +167 -0
- package/lib/properties/CSS Fonts.json +684 -0
- package/lib/properties/CSS Fragmentation.json +110 -0
- package/lib/properties/CSS Generated Content.json +38 -0
- package/lib/properties/CSS Grid Layout.json +500 -0
- package/lib/properties/CSS Images.json +91 -0
- package/lib/properties/CSS Inline.json +38 -0
- package/lib/properties/CSS Lists and Counters.json +86 -0
- package/lib/properties/CSS Logical Properties.json +1086 -0
- package/lib/properties/CSS Masking.json +399 -0
- package/lib/properties/CSS Miscellaneous.json +38 -0
- package/lib/properties/CSS Motion Path.json +132 -0
- package/lib/properties/CSS Overflow.json +216 -0
- package/lib/properties/CSS Pages.json +83 -0
- package/lib/properties/CSS Positioning.json +166 -0
- package/lib/properties/CSS Ruby.json +55 -0
- package/lib/properties/CSS Scroll Anchoring.json +19 -0
- package/lib/properties/CSS Scroll Snap.json +604 -0
- package/lib/properties/CSS Scrollbars.json +38 -0
- package/lib/properties/CSS Shapes.json +56 -0
- package/lib/properties/CSS Speech.json +20 -0
- package/lib/properties/CSS Table.json +115 -0
- package/lib/properties/CSS Text Decoration.json +312 -0
- package/lib/properties/CSS Text.json +415 -0
- package/lib/properties/CSS Transforms.json +188 -0
- package/lib/properties/CSS Transitions.json +122 -0
- package/lib/properties/CSS Variables.json +20 -0
- package/lib/properties/CSS View Transitions.json +20 -0
- package/lib/properties/CSS Will Change.json +20 -0
- package/lib/properties/CSS Writing Modes.json +92 -0
- package/lib/properties/Compositing and Blending.json +62 -0
- package/lib/properties/Filter Effects.json +38 -0
- package/lib/properties/MathML.json +56 -0
- package/lib/properties/Microsoft Extensions.json +885 -0
- package/lib/properties/Mozilla Extensions.json +607 -0
- package/lib/properties/Pointer Events.json +20 -0
- package/lib/properties/WebKit Extensions.json +707 -0
- package/lib/properties.json +10122 -0
- package/lib/{stylex-override-vars.d.ts → stylex-create-theme.d.ts} +2 -2
- package/lib/{stylex-override-vars.js → stylex-create-theme.js} +13 -13
- package/lib/{stylex-override-vars.js.flow → stylex-create-theme.js.flow} +1 -1
- package/lib/stylex-create.js +1 -1
- package/lib/{stylex-create-vars.d.ts → stylex-define-vars.d.ts} +2 -2
- package/lib/{stylex-create-vars.js → stylex-define-vars.js} +9 -9
- package/lib/{stylex-create-vars.js.flow → stylex-define-vars.js.flow} +1 -1
- package/lib/stylex-keyframes.js +6 -6
- package/lib/transform-value.js +13 -15
- package/lib/types/index.js +33 -46
- package/lib/utils/dashify.js +1 -1
- package/lib/utils/default-options.js +4 -5
- package/lib/utils/file-based-identifier.js +1 -1
- package/lib/utils/genCSSRule.js +6 -6
- package/lib/utils/normalize-value.js +3 -2
- package/lib/utils/normalizers/convert-camel-case-transition-props.d.ts +14 -0
- package/lib/utils/normalizers/convert-camel-case-transition-props.js +23 -0
- package/lib/utils/normalizers/convert-camel-case-transition-props.js.flow +13 -0
- package/lib/utils/normalizers/convert-camel-case-values.d.ts +14 -0
- package/lib/utils/normalizers/convert-camel-case-values.js +23 -0
- package/lib/utils/normalizers/convert-camel-case-values.js.flow +13 -0
- package/lib/utils/normalizers/detect-unclosed-fns.js +2 -2
- package/lib/utils/normalizers/font-size-px-to-rem.js +4 -4
- package/lib/utils/normalizers/leading-zero.js +3 -3
- package/lib/utils/normalizers/quotes.js +4 -4
- package/lib/utils/normalizers/timings.js +4 -4
- package/lib/utils/normalizers/whitespace.js +12 -12
- package/lib/utils/normalizers/zero-dimensions.js +8 -8
- package/lib/utils/object-utils.d.ts +3 -6
- package/lib/utils/object-utils.js +2 -2
- package/lib/utils/property-priorities.js +527 -88
- package/lib/utils/split-css-value.js +8 -8
- package/lib/validate.js +2 -2
- package/package.json +2 -2
@@ -4,98 +4,537 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = getPriority;
|
7
|
+
const longHandPhysical = new Set();
|
8
|
+
const longHandLogical = new Set();
|
9
|
+
const shorthandsOfLonghands = new Set();
|
10
|
+
const shorthandsOfShorthands = new Set();
|
11
|
+
longHandLogical.add('background-blend-mode');
|
12
|
+
longHandLogical.add('isolation');
|
13
|
+
longHandLogical.add('mix-blend-mode');
|
14
|
+
shorthandsOfShorthands.add('animation');
|
15
|
+
longHandLogical.add('animation-composition');
|
16
|
+
longHandLogical.add('animation-delay');
|
17
|
+
longHandLogical.add('animation-direction');
|
18
|
+
longHandLogical.add('animation-duration');
|
19
|
+
longHandLogical.add('animation-fill-mode');
|
20
|
+
longHandLogical.add('animation-iteration-count');
|
21
|
+
longHandLogical.add('animation-name');
|
22
|
+
longHandLogical.add('animation-play-state');
|
23
|
+
shorthandsOfLonghands.add('animation-range');
|
24
|
+
longHandLogical.add('animation-range-end');
|
25
|
+
longHandLogical.add('animation-range-start');
|
26
|
+
longHandLogical.add('animation-timing-function');
|
27
|
+
longHandLogical.add('animation-timeline');
|
28
|
+
shorthandsOfLonghands.add('scroll-timeline');
|
29
|
+
longHandLogical.add('scroll-timeline-axis');
|
30
|
+
longHandLogical.add('scroll-timeline-name');
|
31
|
+
longHandLogical.add('timeline-scope');
|
32
|
+
shorthandsOfLonghands.add('view-timeline');
|
33
|
+
longHandLogical.add('view-timeline-axis');
|
34
|
+
longHandLogical.add('view-timeline-inset');
|
35
|
+
longHandLogical.add('view-timeline-name');
|
36
|
+
shorthandsOfShorthands.add('background');
|
37
|
+
longHandLogical.add('background-attachment');
|
38
|
+
longHandLogical.add('background-clip');
|
39
|
+
longHandLogical.add('background-color');
|
40
|
+
longHandLogical.add('background-image');
|
41
|
+
longHandLogical.add('background-origin');
|
42
|
+
longHandLogical.add('background-repeat');
|
43
|
+
longHandLogical.add('background-size');
|
44
|
+
shorthandsOfLonghands.add('background-position');
|
45
|
+
longHandLogical.add('background-position-x');
|
46
|
+
longHandLogical.add('background-position-y');
|
47
|
+
shorthandsOfShorthands.add('border');
|
48
|
+
shorthandsOfLonghands.add('border-color');
|
49
|
+
shorthandsOfLonghands.add('border-style');
|
50
|
+
shorthandsOfLonghands.add('border-width');
|
51
|
+
shorthandsOfShorthands.add('border-block');
|
52
|
+
longHandLogical.add('border-block-color');
|
53
|
+
longHandLogical.add('border-block-stylex');
|
54
|
+
longHandLogical.add('border-block-width');
|
55
|
+
shorthandsOfLonghands.add('border-block-start');
|
56
|
+
shorthandsOfLonghands.add('border-top');
|
57
|
+
longHandLogical.add('border-block-start-color');
|
58
|
+
longHandLogical.add('border-top-color');
|
59
|
+
longHandLogical.add('border-block-start-style');
|
60
|
+
longHandLogical.add('border-top-style');
|
61
|
+
longHandLogical.add('border-block-start-width');
|
62
|
+
longHandLogical.add('border-top-width');
|
63
|
+
shorthandsOfLonghands.add('border-block-end');
|
64
|
+
shorthandsOfLonghands.add('border-bottom');
|
65
|
+
longHandLogical.add('border-block-end-color');
|
66
|
+
longHandPhysical.add('border-bottom-color');
|
67
|
+
longHandLogical.add('border-block-end-style');
|
68
|
+
longHandPhysical.add('border-bottom-style');
|
69
|
+
longHandLogical.add('border-block-end-width');
|
70
|
+
longHandPhysical.add('border-bottom-width');
|
71
|
+
shorthandsOfShorthands.add('border-inline');
|
72
|
+
shorthandsOfLonghands.add('border-inline-color');
|
73
|
+
shorthandsOfLonghands.add('border-inline-style');
|
74
|
+
shorthandsOfLonghands.add('border-inline-width');
|
75
|
+
shorthandsOfLonghands.add('border-inline-start');
|
76
|
+
shorthandsOfLonghands.add('border-left');
|
77
|
+
longHandLogical.add('border-inline-start-color');
|
78
|
+
longHandPhysical.add('border-left-color');
|
79
|
+
longHandLogical.add('border-inline-start-style');
|
80
|
+
longHandPhysical.add('border-left-style');
|
81
|
+
longHandLogical.add('border-inline-start-width');
|
82
|
+
longHandPhysical.add('border-left-width');
|
83
|
+
shorthandsOfLonghands.add('border-inline-end');
|
84
|
+
shorthandsOfLonghands.add('border-right');
|
85
|
+
longHandLogical.add('border-inline-end-color');
|
86
|
+
longHandPhysical.add('border-right-color');
|
87
|
+
longHandLogical.add('border-inline-end-style');
|
88
|
+
longHandPhysical.add('border-right-style');
|
89
|
+
longHandLogical.add('border-inline-end-width');
|
90
|
+
longHandPhysical.add('border-right-width');
|
91
|
+
shorthandsOfLonghands.add('border-image');
|
92
|
+
longHandLogical.add('border-image-outset');
|
93
|
+
longHandLogical.add('border-image-repeat');
|
94
|
+
longHandLogical.add('border-image-slice');
|
95
|
+
longHandLogical.add('border-image-source');
|
96
|
+
longHandLogical.add('border-image-width');
|
97
|
+
shorthandsOfLonghands.add('border-radius');
|
98
|
+
longHandLogical.add('border-start-end-radius');
|
99
|
+
longHandLogical.add('border-start-start-radius');
|
100
|
+
longHandLogical.add('border-end-end-radius');
|
101
|
+
longHandLogical.add('border-end-start-radius');
|
102
|
+
longHandPhysical.add('border-top-left-radius');
|
103
|
+
longHandPhysical.add('border-top-right-radius');
|
104
|
+
longHandPhysical.add('border-bottom-left-radius');
|
105
|
+
longHandPhysical.add('border-bottom-right-radius');
|
106
|
+
longHandLogical.add('box-shadow');
|
107
|
+
longHandLogical.add('accent-color');
|
108
|
+
longHandLogical.add('appearance');
|
109
|
+
longHandLogical.add('aspect-ratio');
|
110
|
+
shorthandsOfLonghands.add('caret');
|
111
|
+
longHandLogical.add('caret-color');
|
112
|
+
longHandLogical.add('caret-shape');
|
113
|
+
longHandLogical.add('cursor');
|
114
|
+
longHandLogical.add('ime-mode');
|
115
|
+
longHandLogical.add('input-security');
|
116
|
+
shorthandsOfLonghands.add('outline');
|
117
|
+
longHandLogical.add('outline-color');
|
118
|
+
longHandLogical.add('outline-offset');
|
119
|
+
longHandLogical.add('outline-style');
|
120
|
+
longHandLogical.add('outline-width');
|
121
|
+
longHandLogical.add('pointer-events');
|
122
|
+
longHandLogical.add('resize');
|
123
|
+
longHandLogical.add('text-overflow');
|
124
|
+
longHandLogical.add('user-select');
|
125
|
+
shorthandsOfLonghands.add('grid-gap');
|
126
|
+
shorthandsOfLonghands.add('gap');
|
127
|
+
longHandLogical.add('grid-row-gap');
|
128
|
+
longHandLogical.add('row-gap');
|
129
|
+
longHandLogical.add('grid-column-gap');
|
130
|
+
longHandLogical.add('column-gap');
|
131
|
+
shorthandsOfLonghands.add('place-content');
|
132
|
+
longHandLogical.add('align-content');
|
133
|
+
longHandLogical.add('justify-content');
|
134
|
+
shorthandsOfLonghands.add('place-items');
|
135
|
+
longHandLogical.add('align-items');
|
136
|
+
longHandLogical.add('justify-items');
|
137
|
+
shorthandsOfLonghands.add('place-self');
|
138
|
+
longHandLogical.add('align-self');
|
139
|
+
longHandLogical.add('justify-self');
|
140
|
+
longHandLogical.add('box-sizing');
|
141
|
+
longHandLogical.add('block-size');
|
142
|
+
longHandPhysical.add('height');
|
143
|
+
longHandLogical.add('inline-size');
|
144
|
+
longHandPhysical.add('width');
|
145
|
+
longHandLogical.add('max-block-size');
|
146
|
+
longHandPhysical.add('max-height');
|
147
|
+
longHandLogical.add('max-inline-size');
|
148
|
+
longHandPhysical.add('max-width');
|
149
|
+
longHandLogical.add('min-block-size');
|
150
|
+
longHandPhysical.add('min-height');
|
151
|
+
longHandLogical.add('min-inline-size');
|
152
|
+
longHandPhysical.add('min-width');
|
153
|
+
shorthandsOfShorthands.add('margin');
|
154
|
+
shorthandsOfLonghands.add('margin-block');
|
155
|
+
longHandLogical.add('margin-block-start');
|
156
|
+
longHandPhysical.add('margin-top');
|
157
|
+
longHandLogical.add('margin-block-end');
|
158
|
+
longHandPhysical.add('margin-bottom');
|
159
|
+
shorthandsOfLonghands.add('margin-inline');
|
160
|
+
longHandLogical.add('margin-inline-start');
|
161
|
+
longHandPhysical.add('margin-left');
|
162
|
+
longHandLogical.add('margin-inline-end');
|
163
|
+
longHandPhysical.add('margin-right');
|
164
|
+
longHandLogical.add('margin-trim');
|
165
|
+
shorthandsOfLonghands.add('overscroll-behavior');
|
166
|
+
longHandLogical.add('overscroll-behavior-block');
|
167
|
+
longHandPhysical.add('overscroll-behavior-y');
|
168
|
+
longHandLogical.add('overscroll-behavior-inline');
|
169
|
+
longHandPhysical.add('overscroll-behavior-x');
|
170
|
+
shorthandsOfShorthands.add('padding');
|
171
|
+
shorthandsOfLonghands.add('padding-block');
|
172
|
+
longHandLogical.add('padding-block-start');
|
173
|
+
longHandPhysical.add('padding-top');
|
174
|
+
longHandLogical.add('padding-block-end');
|
175
|
+
longHandPhysical.add('padding-bottom');
|
176
|
+
shorthandsOfLonghands.add('padding-inline');
|
177
|
+
longHandLogical.add('padding-inline-start');
|
178
|
+
longHandPhysical.add('padding-left');
|
179
|
+
longHandLogical.add('padding-inline-end');
|
180
|
+
longHandPhysical.add('padding-right');
|
181
|
+
longHandLogical.add('visibility');
|
182
|
+
longHandLogical.add('color');
|
183
|
+
longHandLogical.add('color-scheme');
|
184
|
+
longHandLogical.add('forced-color-adjust');
|
185
|
+
longHandLogical.add('opacity');
|
186
|
+
longHandLogical.add('print-color-adjust');
|
187
|
+
shorthandsOfLonghands.add('columns');
|
188
|
+
longHandLogical.add('column-count');
|
189
|
+
longHandLogical.add('column-width');
|
190
|
+
longHandLogical.add('column-fill');
|
191
|
+
longHandLogical.add('column-span');
|
192
|
+
shorthandsOfLonghands.add('column-rule');
|
193
|
+
longHandLogical.add('column-rule-color');
|
194
|
+
longHandLogical.add('column-rule-style');
|
195
|
+
longHandLogical.add('column-rule-width');
|
196
|
+
longHandLogical.add('contain');
|
197
|
+
shorthandsOfLonghands.add('contain-intrinsic-size');
|
198
|
+
longHandLogical.add('contain-intrinsic-block-size');
|
199
|
+
longHandLogical.add('contain-intrinsic-width');
|
200
|
+
longHandLogical.add('contain-intrinsic-height');
|
201
|
+
longHandLogical.add('contain-intrinsic-inline-size');
|
202
|
+
shorthandsOfLonghands.add('container');
|
203
|
+
longHandLogical.add('container-name');
|
204
|
+
longHandLogical.add('container-type');
|
205
|
+
longHandLogical.add('content-visibility');
|
206
|
+
longHandLogical.add('counter-increment');
|
207
|
+
longHandLogical.add('counter-reset');
|
208
|
+
longHandLogical.add('counter-set');
|
209
|
+
longHandLogical.add('display');
|
210
|
+
shorthandsOfLonghands.add('flex');
|
211
|
+
longHandLogical.add('flex-basis');
|
212
|
+
longHandLogical.add('flex-grow');
|
213
|
+
longHandLogical.add('flex-shrink');
|
214
|
+
shorthandsOfLonghands.add('flex-flow');
|
215
|
+
longHandLogical.add('flex-direction');
|
216
|
+
longHandLogical.add('flex-wrap');
|
217
|
+
longHandLogical.add('order');
|
218
|
+
shorthandsOfShorthands.add('font');
|
219
|
+
longHandLogical.add('font-family');
|
220
|
+
longHandLogical.add('font-size');
|
221
|
+
longHandLogical.add('font-stretch');
|
222
|
+
longHandLogical.add('font-style');
|
223
|
+
longHandLogical.add('font-weight');
|
224
|
+
longHandLogical.add('line-height');
|
225
|
+
shorthandsOfLonghands.add('font-variant');
|
226
|
+
longHandLogical.add('font-variant-alternates');
|
227
|
+
longHandLogical.add('font-variant-caps');
|
228
|
+
longHandLogical.add('font-variant-east-asian');
|
229
|
+
longHandLogical.add('font-variant-emoji');
|
230
|
+
longHandLogical.add('font-variant-ligatures');
|
231
|
+
longHandLogical.add('font-variant-numeric');
|
232
|
+
longHandLogical.add('font-variant-position');
|
233
|
+
longHandLogical.add('font-feature-settings');
|
234
|
+
longHandLogical.add('font-kerning');
|
235
|
+
longHandLogical.add('font-language-override');
|
236
|
+
longHandLogical.add('font-optical-sizing');
|
237
|
+
longHandLogical.add('font-palette');
|
238
|
+
longHandLogical.add('font-variation-settings');
|
239
|
+
longHandLogical.add('font-size-adjust');
|
240
|
+
longHandLogical.add('font-smooth');
|
241
|
+
longHandLogical.add('font-synthesis-position');
|
242
|
+
longHandLogical.add('font-synthesis-small-caps');
|
243
|
+
longHandLogical.add('font-synthesis-style');
|
244
|
+
longHandLogical.add('font-synthesis-weight');
|
245
|
+
longHandLogical.add('line-height-step');
|
246
|
+
longHandLogical.add('box-decoration-break');
|
247
|
+
longHandLogical.add('break-after');
|
248
|
+
longHandLogical.add('break-before');
|
249
|
+
longHandLogical.add('break-inside');
|
250
|
+
longHandLogical.add('orphans');
|
251
|
+
longHandLogical.add('widows');
|
252
|
+
longHandLogical.add('content');
|
253
|
+
longHandLogical.add('quotes');
|
254
|
+
shorthandsOfShorthands.add('grid');
|
255
|
+
longHandLogical.add('grid-auto-flow');
|
256
|
+
longHandLogical.add('grid-auto-rows');
|
257
|
+
longHandLogical.add('grid-auto-columns');
|
258
|
+
shorthandsOfShorthands.add('grid-template');
|
259
|
+
shorthandsOfLonghands.add('grid-template-areas');
|
260
|
+
longHandLogical.add('grid-template-columns');
|
261
|
+
longHandLogical.add('grid-template-rows');
|
262
|
+
shorthandsOfShorthands.add('grid-area');
|
263
|
+
shorthandsOfLonghands.add('grid-row');
|
264
|
+
longHandLogical.add('grid-row-start');
|
265
|
+
longHandLogical.add('grid-row-end');
|
266
|
+
shorthandsOfLonghands.add('grid-column');
|
267
|
+
longHandLogical.add('grid-column-start');
|
268
|
+
longHandLogical.add('grid-column-end');
|
269
|
+
longHandLogical.add('align-tracks');
|
270
|
+
longHandLogical.add('justify-tracks');
|
271
|
+
longHandLogical.add('masonry-auto-flow');
|
272
|
+
longHandLogical.add('image-orientation');
|
273
|
+
longHandLogical.add('image-rendering');
|
274
|
+
longHandLogical.add('image-resolution');
|
275
|
+
longHandLogical.add('object-fit');
|
276
|
+
longHandLogical.add('object-position');
|
277
|
+
longHandLogical.add('initial-letter');
|
278
|
+
longHandLogical.add('initial-letter-align');
|
279
|
+
shorthandsOfLonghands.add('list-style');
|
280
|
+
longHandLogical.add('list-style-image');
|
281
|
+
longHandLogical.add('list-style-position');
|
282
|
+
longHandLogical.add('list-style-type');
|
283
|
+
longHandLogical.add('clip');
|
284
|
+
longHandLogical.add('clip-path');
|
285
|
+
shorthandsOfLonghands.add('mask');
|
286
|
+
longHandLogical.add('mask-clip');
|
287
|
+
longHandLogical.add('mask-composite');
|
288
|
+
longHandLogical.add('mask-image');
|
289
|
+
longHandLogical.add('mask-mode');
|
290
|
+
longHandLogical.add('mask-origin');
|
291
|
+
longHandLogical.add('mask-position');
|
292
|
+
longHandLogical.add('mask-repeat');
|
293
|
+
longHandLogical.add('mask-size');
|
294
|
+
longHandLogical.add('mask-type');
|
295
|
+
shorthandsOfLonghands.add('mask-border');
|
296
|
+
longHandLogical.add('mask-border-mode');
|
297
|
+
longHandLogical.add('mask-border-outset');
|
298
|
+
longHandLogical.add('mask-border-repeat');
|
299
|
+
longHandLogical.add('mask-border-slice');
|
300
|
+
longHandLogical.add('mask-border-source');
|
301
|
+
longHandLogical.add('mask-border-width');
|
302
|
+
shorthandsOfShorthands.add('all');
|
303
|
+
longHandLogical.add('text-rendering');
|
304
|
+
shorthandsOfLonghands.add('offset');
|
305
|
+
longHandLogical.add('offset-anchor');
|
306
|
+
longHandLogical.add('offset-distance');
|
307
|
+
longHandLogical.add('offset-path');
|
308
|
+
longHandLogical.add('offset-position');
|
309
|
+
longHandLogical.add('offset-rotate');
|
310
|
+
longHandLogical.add('-webkit-box-orient');
|
311
|
+
longHandLogical.add('-webkit-line-clamp');
|
312
|
+
shorthandsOfLonghands.add('overflow');
|
313
|
+
longHandLogical.add('overflow-block');
|
314
|
+
longHandPhysical.add('overflow-y');
|
315
|
+
longHandLogical.add('overflow-inline');
|
316
|
+
longHandPhysical.add('overflow-x');
|
317
|
+
longHandLogical.add('overflow-clip-margin');
|
318
|
+
longHandLogical.add('scroll-gutter');
|
319
|
+
longHandLogical.add('scroll-behavior');
|
320
|
+
longHandLogical.add('page');
|
321
|
+
longHandLogical.add('page-break-after');
|
322
|
+
longHandLogical.add('page-break-before');
|
323
|
+
longHandLogical.add('page-break-inside');
|
324
|
+
shorthandsOfShorthands.add('inset');
|
325
|
+
shorthandsOfLonghands.add('inset-block');
|
326
|
+
longHandLogical.add('inset-block-start');
|
327
|
+
longHandPhysical.add('top');
|
328
|
+
longHandLogical.add('inset-block-end');
|
329
|
+
longHandPhysical.add('bottom');
|
330
|
+
shorthandsOfLonghands.add('inset-inline');
|
331
|
+
longHandLogical.add('inset-inline-start');
|
332
|
+
longHandPhysical.add('left');
|
333
|
+
longHandLogical.add('inset-inline-end');
|
334
|
+
longHandPhysical.add('right');
|
335
|
+
longHandLogical.add('clear');
|
336
|
+
longHandLogical.add('float');
|
337
|
+
longHandLogical.add('overlay');
|
338
|
+
longHandLogical.add('position');
|
339
|
+
longHandLogical.add('z-index');
|
340
|
+
longHandLogical.add('ruby-align');
|
341
|
+
longHandLogical.add('ruby-merge');
|
342
|
+
longHandLogical.add('ruby-position');
|
343
|
+
longHandLogical.add('overflow-anchor');
|
344
|
+
shorthandsOfShorthands.add('scroll-margin');
|
345
|
+
shorthandsOfLonghands.add('scroll-margin-block');
|
346
|
+
longHandLogical.add('scroll-margin-block-start');
|
347
|
+
longHandPhysical.add('scroll-margin-top');
|
348
|
+
longHandLogical.add('scroll-margin-block-end');
|
349
|
+
longHandPhysical.add('scroll-margin-bottom');
|
350
|
+
shorthandsOfLonghands.add('scroll-margin-inline');
|
351
|
+
longHandLogical.add('scroll-margin-inline-start');
|
352
|
+
longHandPhysical.add('scroll-margin-left');
|
353
|
+
longHandLogical.add('scroll-margin-inline-end');
|
354
|
+
longHandPhysical.add('scroll-margin-right');
|
355
|
+
shorthandsOfShorthands.add('scroll-padding');
|
356
|
+
shorthandsOfLonghands.add('scroll-padding-block');
|
357
|
+
longHandLogical.add('scroll-padding-block-start');
|
358
|
+
longHandPhysical.add('scroll-padding-top');
|
359
|
+
longHandLogical.add('scroll-padding-block-end');
|
360
|
+
longHandPhysical.add('scroll-padding-bottom');
|
361
|
+
shorthandsOfLonghands.add('scroll-padding-inline');
|
362
|
+
longHandLogical.add('scroll-padding-inline-start');
|
363
|
+
longHandPhysical.add('scroll-padding-left');
|
364
|
+
longHandLogical.add('scroll-padding-inline-end');
|
365
|
+
longHandPhysical.add('scroll-padding-right');
|
366
|
+
longHandLogical.add('scroll-snap-align');
|
367
|
+
longHandLogical.add('scroll-snap-coordinate');
|
368
|
+
longHandLogical.add('scroll-snap-destination');
|
369
|
+
longHandLogical.add('scroll-snap-points-x');
|
370
|
+
longHandLogical.add('scroll-snap-points-y');
|
371
|
+
longHandLogical.add('scroll-snap-stop');
|
372
|
+
shorthandsOfLonghands.add('scroll-snap-type');
|
373
|
+
longHandLogical.add('scroll-snap-type-x');
|
374
|
+
longHandLogical.add('scroll-snap-type-y');
|
375
|
+
longHandLogical.add('scrollbar-color');
|
376
|
+
longHandLogical.add('scrollbar-width');
|
377
|
+
longHandLogical.add('shape-image-threshold');
|
378
|
+
longHandLogical.add('shape-margin');
|
379
|
+
longHandLogical.add('shape-outside');
|
380
|
+
longHandLogical.add('azimuth');
|
381
|
+
longHandLogical.add('border-collapse');
|
382
|
+
longHandLogical.add('border-spacing');
|
383
|
+
longHandLogical.add('caption-side');
|
384
|
+
longHandLogical.add('empty-cells');
|
385
|
+
longHandLogical.add('table-layout');
|
386
|
+
longHandLogical.add('vertical-align');
|
387
|
+
shorthandsOfLonghands.add('text-decoration');
|
388
|
+
longHandLogical.add('text-decoration-color');
|
389
|
+
longHandLogical.add('text-decoration-line');
|
390
|
+
longHandLogical.add('text-decoration-skip');
|
391
|
+
longHandLogical.add('text-decoration-skip-ink');
|
392
|
+
longHandLogical.add('text-decoration-style');
|
393
|
+
longHandLogical.add('text-decoration-thickness');
|
394
|
+
shorthandsOfLonghands.add('text-emphasis');
|
395
|
+
longHandLogical.add('text-emphasis-color');
|
396
|
+
longHandLogical.add('text-emphasis-position');
|
397
|
+
longHandLogical.add('text-emphasis-style');
|
398
|
+
longHandLogical.add('text-shadow');
|
399
|
+
longHandLogical.add('text-underline-offset');
|
400
|
+
longHandLogical.add('text-underline-position');
|
401
|
+
longHandLogical.add('hanging-punctuation');
|
402
|
+
longHandLogical.add('hyphenate-character');
|
403
|
+
longHandLogical.add('hyphenate-limit-chars');
|
404
|
+
longHandLogical.add('hyphens');
|
405
|
+
longHandLogical.add('letter-spacing');
|
406
|
+
longHandLogical.add('line-break');
|
407
|
+
longHandLogical.add('overflow-wrap');
|
408
|
+
longHandLogical.add('paint-order');
|
409
|
+
longHandLogical.add('tab-size');
|
410
|
+
longHandLogical.add('text-align');
|
411
|
+
longHandLogical.add('text-align-last');
|
412
|
+
longHandLogical.add('text-indent');
|
413
|
+
longHandLogical.add('text-justify');
|
414
|
+
longHandLogical.add('text-size-adjust');
|
415
|
+
longHandLogical.add('text-transform');
|
416
|
+
longHandLogical.add('text-wrap');
|
417
|
+
longHandLogical.add('white-space');
|
418
|
+
longHandLogical.add('white-space-collapse');
|
419
|
+
longHandLogical.add('white-space-trim');
|
420
|
+
longHandLogical.add('word-break');
|
421
|
+
longHandLogical.add('word-spacing');
|
422
|
+
longHandLogical.add('word-wrap');
|
423
|
+
longHandLogical.add('backface-visibility');
|
424
|
+
longHandLogical.add('perspective');
|
425
|
+
longHandLogical.add('perspective-origin');
|
426
|
+
longHandLogical.add('rotate');
|
427
|
+
longHandLogical.add('scale');
|
428
|
+
longHandLogical.add('transform');
|
429
|
+
longHandLogical.add('transform-box');
|
430
|
+
longHandLogical.add('transform-origin');
|
431
|
+
longHandLogical.add('transform-style');
|
432
|
+
longHandLogical.add('translate');
|
433
|
+
shorthandsOfLonghands.add('transition');
|
434
|
+
longHandLogical.add('transition-behavior');
|
435
|
+
longHandLogical.add('transition-delay');
|
436
|
+
longHandLogical.add('transition-duration');
|
437
|
+
longHandLogical.add('transition-property');
|
438
|
+
longHandLogical.add('transition-timing-function');
|
439
|
+
longHandLogical.add('view-transition-name');
|
440
|
+
longHandLogical.add('will-change');
|
441
|
+
longHandLogical.add('direction');
|
442
|
+
longHandLogical.add('text-combine-upright');
|
443
|
+
longHandLogical.add('text-orientation');
|
444
|
+
longHandLogical.add('unicode-bidi');
|
445
|
+
longHandLogical.add('writing-mode');
|
446
|
+
longHandLogical.add('backdrop-filter');
|
447
|
+
longHandLogical.add('filter');
|
448
|
+
longHandLogical.add('math-depth');
|
449
|
+
longHandLogical.add('math-shift');
|
450
|
+
longHandLogical.add('math-style');
|
451
|
+
longHandLogical.add('touch-action');
|
7
452
|
const PRIORITIES = {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
":any-link": 8.1,
|
62
|
-
":target": 8.2,
|
63
|
-
":visited": 8.3,
|
64
|
-
":enabled": 9.1,
|
65
|
-
":disabled": 9.2,
|
66
|
-
":required": 9.3,
|
67
|
-
":optional": 9.4,
|
68
|
-
":read-only": 9.5,
|
69
|
-
":read-write": 9.6,
|
70
|
-
":placeholder-shown": 9.7,
|
71
|
-
":default": 10,
|
72
|
-
":checked": 10.1,
|
73
|
-
":indeterminate": 10.1,
|
74
|
-
":blank": 10.2,
|
75
|
-
":valid": 10.3,
|
76
|
-
":invalid": 10.4,
|
77
|
-
":autofill": 11,
|
78
|
-
":picture-in-picture": 12,
|
79
|
-
":fullscreen": 12.1,
|
80
|
-
":paused": 12.2,
|
81
|
-
":playing": 12.3,
|
82
|
-
":hover": 13,
|
83
|
-
":focusWithin": 14,
|
84
|
-
":focusVisible": 15,
|
85
|
-
":focus": 16,
|
86
|
-
":active": 17
|
453
|
+
':is': 40,
|
454
|
+
':where': 40,
|
455
|
+
':not': 40,
|
456
|
+
':has': 45,
|
457
|
+
':dir': 50,
|
458
|
+
':lang': 51,
|
459
|
+
':first-child': 52,
|
460
|
+
':first-of-type': 53,
|
461
|
+
':last-child': 54,
|
462
|
+
':last-of-type': 55,
|
463
|
+
':only-child': 56,
|
464
|
+
':only-of-type': 57,
|
465
|
+
':nth-child': 60,
|
466
|
+
':nth-last-child': 61,
|
467
|
+
':nth-of-type': 62,
|
468
|
+
':nth-last-of-type': 63,
|
469
|
+
':empty': 70,
|
470
|
+
':link': 80,
|
471
|
+
':any-link': 81,
|
472
|
+
':local-link': 82,
|
473
|
+
':target-within': 83,
|
474
|
+
':target': 84,
|
475
|
+
':visited': 85,
|
476
|
+
':enabled': 91,
|
477
|
+
':disabled': 92,
|
478
|
+
':required': 93,
|
479
|
+
':optional': 94,
|
480
|
+
':read-only': 95,
|
481
|
+
':read-write': 96,
|
482
|
+
':placeholder-shown': 97,
|
483
|
+
':in-range': 98,
|
484
|
+
':out-of-range': 99,
|
485
|
+
':default': 100,
|
486
|
+
':checked': 101,
|
487
|
+
':indeterminate': 101,
|
488
|
+
':blank': 102,
|
489
|
+
':valid': 103,
|
490
|
+
':invalid': 104,
|
491
|
+
':user-invalid': 105,
|
492
|
+
':autofill': 110,
|
493
|
+
':picture-in-picture': 120,
|
494
|
+
':modal': 121,
|
495
|
+
':fullscreen': 122,
|
496
|
+
':paused': 123,
|
497
|
+
':playing': 124,
|
498
|
+
':current': 125,
|
499
|
+
':past': 126,
|
500
|
+
':future': 127,
|
501
|
+
':hover': 130,
|
502
|
+
':focusWithin': 140,
|
503
|
+
':focus': 150,
|
504
|
+
':focusVisible': 160,
|
505
|
+
':active': 170
|
87
506
|
};
|
88
507
|
function getPriority(key) {
|
89
|
-
if (key.startsWith(
|
90
|
-
return
|
508
|
+
if (key.startsWith('--')) {
|
509
|
+
return 1;
|
91
510
|
}
|
92
|
-
if (key.startsWith(
|
93
|
-
return
|
511
|
+
if (key.startsWith('@supports')) {
|
512
|
+
return 30;
|
94
513
|
}
|
95
|
-
|
96
|
-
|
97
|
-
if (key.toLowerCase().includes("left") || key.toLowerCase().includes("right")) {
|
98
|
-
priority += 0.1;
|
514
|
+
if (key.startsWith('@media')) {
|
515
|
+
return 200;
|
99
516
|
}
|
100
|
-
|
517
|
+
if (key.startsWith('@container')) {
|
518
|
+
return 300;
|
519
|
+
}
|
520
|
+
if (key.startsWith('::')) {
|
521
|
+
return 5000;
|
522
|
+
}
|
523
|
+
if (key.startsWith(':')) {
|
524
|
+
const prop = key.startsWith(':') && key.includes('(') ? key.slice(0, key.indexOf('(')) : key;
|
525
|
+
return PRIORITIES[prop] ?? 40;
|
526
|
+
}
|
527
|
+
if (longHandPhysical.has(key)) {
|
528
|
+
return 4000;
|
529
|
+
}
|
530
|
+
if (longHandLogical.has(key)) {
|
531
|
+
return 3000;
|
532
|
+
}
|
533
|
+
if (shorthandsOfLonghands.has(key)) {
|
534
|
+
return 2000;
|
535
|
+
}
|
536
|
+
if (shorthandsOfShorthands.has(key)) {
|
537
|
+
return 1000;
|
538
|
+
}
|
539
|
+
return 3000;
|
101
540
|
}
|
@@ -8,26 +8,26 @@ var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser")
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
9
9
|
function printNode(node) {
|
10
10
|
switch (node.type) {
|
11
|
-
case
|
12
|
-
case
|
11
|
+
case 'word':
|
12
|
+
case 'string':
|
13
13
|
return `${node.value}`;
|
14
|
-
case
|
15
|
-
return `${node.value}(${node.nodes.map(printNode).join(
|
14
|
+
case 'function':
|
15
|
+
return `${node.value}(${node.nodes.map(printNode).join('')})`;
|
16
16
|
default:
|
17
17
|
return node.value;
|
18
18
|
}
|
19
19
|
}
|
20
20
|
function splitValue(str) {
|
21
|
-
if (str == null || typeof str ===
|
21
|
+
if (str == null || typeof str === 'number') {
|
22
22
|
return [str];
|
23
23
|
}
|
24
24
|
if (Array.isArray(str)) {
|
25
25
|
return str;
|
26
26
|
}
|
27
27
|
const parsed = (0, _postcssValueParser.default)(str.trim());
|
28
|
-
const nodes = parsed.nodes.filter(node => node.type !==
|
29
|
-
if (nodes.length > 1 && nodes[nodes.length - 1].toLowerCase() ===
|
30
|
-
return nodes.slice(0, nodes.length - 1).map(node => node +
|
28
|
+
const nodes = parsed.nodes.filter(node => node.type !== 'space' && node.type !== 'div').map(printNode);
|
29
|
+
if (nodes.length > 1 && nodes[nodes.length - 1].toLowerCase() === '!important') {
|
30
|
+
return nodes.slice(0, nodes.length - 1).map(node => node + ' !important');
|
31
31
|
}
|
32
32
|
return nodes;
|
33
33
|
}
|
package/lib/validate.js
CHANGED
@@ -15,7 +15,7 @@ function validateEntry(_ref) {
|
|
15
15
|
function validateSimplyEntry(_ref2) {
|
16
16
|
let [key, _value] = _ref2;
|
17
17
|
if (BANNED_KEYS.has(key)) {
|
18
|
-
throw new Error(
|
18
|
+
throw new Error('Banned key: ' + key);
|
19
19
|
}
|
20
20
|
}
|
21
|
-
const BANNED_KEYS = new Set([
|
21
|
+
const BANNED_KEYS = new Set(['background', 'transition', 'grid']);
|