mancha 0.23.1 → 0.24.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/README.md +25 -7
- package/dist/browser.d.ts +454 -3
- package/dist/browser.js +32 -1
- package/dist/css_custom.d.ts +1 -1
- package/dist/css_custom.js +44 -11
- package/dist/css_custom.js.map +1 -1
- package/dist/css_gen_utils.d.ts +8 -915
- package/dist/css_gen_utils.js +382 -641
- package/dist/css_gen_utils.js.map +1 -1
- package/dist/mancha.js +25 -36
- package/dist/plugins.js +11 -1
- package/dist/plugins.js.map +1 -1
- package/dist/renderer.js +5 -1
- package/dist/renderer.js.map +1 -1
- package/dist/store.d.ts +38 -2
- package/dist/store.js +215 -35
- package/dist/store.js.map +1 -1
- package/dist/trusted_attributes.d.ts +0 -3
- package/dist/trusted_attributes.js +1 -3
- package/dist/trusted_attributes.js.map +1 -1
- package/docs/02_initialization.md +2 -2
- package/docs/03_reactivity.md +26 -3
- package/docs/05_css.md +314 -282
- package/package.json +19 -4
- package/.biomeignore +0 -3
- package/.github/workflows/ci.yml +0 -109
- package/.vscode/extensions.json +0 -3
- package/.vscode/launch.json +0 -34
- package/biome.json +0 -46
- package/dist/browser.js.map +0 -1
- package/dist/expressions/ast.test.d.ts +0 -1
- package/dist/expressions/ast.test.js +0 -147
- package/dist/expressions/ast.test.js.map +0 -1
- package/dist/expressions/ast_factory.test.d.ts +0 -1
- package/dist/expressions/ast_factory.test.js +0 -94
- package/dist/expressions/ast_factory.test.js.map +0 -1
- package/dist/expressions/constants.test.d.ts +0 -1
- package/dist/expressions/constants.test.js +0 -84
- package/dist/expressions/constants.test.js.map +0 -1
- package/dist/expressions/eval.test.d.ts +0 -1
- package/dist/expressions/eval.test.js +0 -215
- package/dist/expressions/eval.test.js.map +0 -1
- package/dist/expressions/expressions.test.d.ts +0 -6
- package/dist/expressions/expressions.test.js +0 -7
- package/dist/expressions/expressions.test.js.map +0 -1
- package/dist/expressions/parser.test.d.ts +0 -1
- package/dist/expressions/parser.test.js +0 -174
- package/dist/expressions/parser.test.js.map +0 -1
- package/dist/expressions/tokenizer.test.d.ts +0 -1
- package/dist/expressions/tokenizer.test.js +0 -124
- package/dist/expressions/tokenizer.test.js.map +0 -1
- package/dist/interfaces-DhL-_vL-.d.ts +0 -423
- package/dist/mancha.js.map +0 -1
- package/dist/renderer-1jqgJa7K.js +0 -43
- package/dist/safe_browser.d.ts +0 -16
- package/dist/safe_browser.js +0 -1
- package/dist/safe_browser.js.map +0 -1
- package/dist/test_types/api.d.ts +0 -11
- package/dist/test_types/api.js +0 -3
- package/dist/test_types/api.js.map +0 -1
- package/dist/test_types/nested/child.d.ts +0 -12
- package/dist/test_types/nested/child.js +0 -2
- package/dist/test_types/nested/child.js.map +0 -1
- package/dist/test_types/product.d.ts +0 -11
- package/dist/test_types/product.js +0 -3
- package/dist/test_types/product.js.map +0 -1
- package/dist/test_types/user.d.ts +0 -10
- package/dist/test_types/user.js +0 -3
- package/dist/test_types/user.js.map +0 -1
- package/dist/test_utils.d.ts +0 -20
- package/dist/test_utils.js +0 -94
- package/dist/test_utils.js.map +0 -1
- package/global.d.ts +0 -4
- package/gulpfile.ts +0 -47
- package/scripts/generate-css-docs.ts +0 -582
- package/tsconfig.json +0 -37
- package/tsdown.config.ts +0 -32
- package/tsec_exemptions.json +0 -9
package/dist/css_gen_utils.js
CHANGED
|
@@ -14,10 +14,11 @@ export const UNITS_ALL = [
|
|
|
14
14
|
export const PERCENTS = Array.from({ length: 20 }, (_, i) => (i + 1) * 5);
|
|
15
15
|
export const COLOR_OPACITY_MODIFIERS = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
|
|
16
16
|
export const DURATIONS = [25, 50, 75, 100, 150, 200, 300, 500, 700, 1000];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
17
|
+
// Margin and padding share a shape but not a value grammar: margin takes
|
|
18
|
+
// negatives and `auto`, padding takes neither.
|
|
19
|
+
export const PROPS_MARGIN = { margin: "m" };
|
|
20
|
+
export const PROPS_PADDING = { padding: "p" };
|
|
21
|
+
export const PROPS_SPACING = { ...PROPS_MARGIN, ...PROPS_PADDING };
|
|
21
22
|
export const PROPS_SIZING = {
|
|
22
23
|
width: "w",
|
|
23
24
|
height: "h",
|
|
@@ -36,695 +37,437 @@ export const PROPS_SIZING_MINMAX = {
|
|
|
36
37
|
};
|
|
37
38
|
// Shared timing-function and duration so every transition helper animates
|
|
38
39
|
// standalone (e.g. `transition-opacity duration-300`) without needing `transition`.
|
|
39
|
-
const TRANSITION_BASE =
|
|
40
|
-
"transition-timing-function": "ease-in-out",
|
|
41
|
-
"transition-duration": "var(--transition-duration, 150ms)",
|
|
42
|
-
};
|
|
40
|
+
const TRANSITION_BASE = "transition-timing-function: ease-in-out; transition-duration: var(--transition-duration, 150ms)";
|
|
43
41
|
export const PROPS_CUSTOM = {
|
|
44
42
|
// Based on https://tailwindcss.com.
|
|
45
43
|
// Font family.
|
|
46
|
-
"font-mono":
|
|
47
|
-
"font-sans":
|
|
48
|
-
"font-serif":
|
|
49
|
-
"font-cursive":
|
|
44
|
+
"font-mono": "font-family: monospace",
|
|
45
|
+
"font-sans": "font-family: sans-serif",
|
|
46
|
+
"font-serif": "font-family: serif",
|
|
47
|
+
"font-cursive": "font-family: cursive",
|
|
50
48
|
// Font size.
|
|
51
|
-
"text-xs":
|
|
52
|
-
"text-sm":
|
|
53
|
-
"text-base":
|
|
54
|
-
"text-lg":
|
|
55
|
-
"text-xl":
|
|
56
|
-
"text-2xl":
|
|
57
|
-
"text-3xl":
|
|
58
|
-
"text-4xl":
|
|
59
|
-
"text-5xl":
|
|
60
|
-
"text-6xl":
|
|
61
|
-
"text-7xl":
|
|
49
|
+
"text-xs": "font-size: .75rem; line-height: calc(1 / 0.75)",
|
|
50
|
+
"text-sm": "font-size: .875rem; line-height: calc(1.25 / 0.875)",
|
|
51
|
+
"text-base": "font-size: 1rem; line-height: calc(1.5 / 1)",
|
|
52
|
+
"text-lg": "font-size: 1.125rem; line-height: calc(1.75 / 1.125)",
|
|
53
|
+
"text-xl": "font-size: 1.25rem; line-height: calc(1.75 / 1.25)",
|
|
54
|
+
"text-2xl": "font-size: 1.5rem; line-height: calc(2 / 1.5)",
|
|
55
|
+
"text-3xl": "font-size: 1.875rem; line-height: calc(2.25 / 1.875)",
|
|
56
|
+
"text-4xl": "font-size: 2.25rem; line-height: calc(2.5 / 2.25)",
|
|
57
|
+
"text-5xl": "font-size: 3rem; line-height: 1",
|
|
58
|
+
"text-6xl": "font-size: 3.75rem; line-height: 1",
|
|
59
|
+
"text-7xl": "font-size: 4.5rem; line-height: 1",
|
|
62
60
|
// Font weight.
|
|
63
|
-
"font-thin":
|
|
64
|
-
"font-extralight":
|
|
65
|
-
"font-light":
|
|
66
|
-
"font-normal":
|
|
67
|
-
"font-medium":
|
|
68
|
-
"font-semibold":
|
|
69
|
-
"font-bold":
|
|
70
|
-
"font-extrabold":
|
|
71
|
-
"font-black":
|
|
61
|
+
"font-thin": "font-weight: 100",
|
|
62
|
+
"font-extralight": "font-weight: 200",
|
|
63
|
+
"font-light": "font-weight: 300",
|
|
64
|
+
"font-normal": "font-weight: 400",
|
|
65
|
+
"font-medium": "font-weight: 500",
|
|
66
|
+
"font-semibold": "font-weight: 600",
|
|
67
|
+
"font-bold": "font-weight: 700",
|
|
68
|
+
"font-extrabold": "font-weight: 800",
|
|
69
|
+
"font-black": "font-weight: 900",
|
|
72
70
|
// Font style.
|
|
73
|
-
italic:
|
|
74
|
-
"not-italic":
|
|
71
|
+
italic: "font-style: italic",
|
|
72
|
+
"not-italic": "font-style: normal",
|
|
75
73
|
// Sizing.
|
|
76
|
-
"w-max":
|
|
77
|
-
"w-min":
|
|
78
|
-
"w-fit":
|
|
79
|
-
"h-max":
|
|
80
|
-
"h-min":
|
|
81
|
-
"h-fit":
|
|
82
|
-
"size-auto":
|
|
83
|
-
"size-px":
|
|
84
|
-
"size-full":
|
|
85
|
-
"size-dvw":
|
|
86
|
-
"size-dvh":
|
|
87
|
-
"size-lvw":
|
|
88
|
-
"size-lvh":
|
|
89
|
-
"size-svw":
|
|
90
|
-
"size-svh":
|
|
91
|
-
"size-min":
|
|
92
|
-
"size-max":
|
|
93
|
-
"size-fit":
|
|
74
|
+
"w-max": "width: max-content",
|
|
75
|
+
"w-min": "width: min-content",
|
|
76
|
+
"w-fit": "width: fit-content",
|
|
77
|
+
"h-max": "height: max-content",
|
|
78
|
+
"h-min": "height: min-content",
|
|
79
|
+
"h-fit": "height: fit-content",
|
|
80
|
+
"size-auto": "width: auto; height: auto",
|
|
81
|
+
"size-px": "width: 1px; height: 1px",
|
|
82
|
+
"size-full": "width: 100%; height: 100%",
|
|
83
|
+
"size-dvw": "width: 100dvw; height: 100dvw",
|
|
84
|
+
"size-dvh": "width: 100dvh; height: 100dvh",
|
|
85
|
+
"size-lvw": "width: 100lvw; height: 100lvw",
|
|
86
|
+
"size-lvh": "width: 100lvh; height: 100lvh",
|
|
87
|
+
"size-svw": "width: 100svw; height: 100svw",
|
|
88
|
+
"size-svh": "width: 100svh; height: 100svh",
|
|
89
|
+
"size-min": "width: min-content; height: min-content",
|
|
90
|
+
"size-max": "width: max-content; height: max-content",
|
|
91
|
+
"size-fit": "width: fit-content; height: fit-content",
|
|
94
92
|
// Letter spacing.
|
|
95
|
-
"tracking-tighter":
|
|
96
|
-
"tracking-tight":
|
|
97
|
-
"tracking-normal":
|
|
98
|
-
"tracking-wide":
|
|
99
|
-
"tracking-wider":
|
|
100
|
-
"tracking-widest":
|
|
93
|
+
"tracking-tighter": "letter-spacing: -0.05em",
|
|
94
|
+
"tracking-tight": "letter-spacing: -0.025em",
|
|
95
|
+
"tracking-normal": "letter-spacing: 0",
|
|
96
|
+
"tracking-wide": "letter-spacing: 0.025em",
|
|
97
|
+
"tracking-wider": "letter-spacing: 0.05em",
|
|
98
|
+
"tracking-widest": "letter-spacing: 0.1em",
|
|
101
99
|
// Line height.
|
|
102
|
-
"leading-none":
|
|
103
|
-
"leading-tight":
|
|
104
|
-
"leading-snug":
|
|
105
|
-
"leading-normal":
|
|
106
|
-
"leading-relaxed":
|
|
107
|
-
"leading-loose":
|
|
100
|
+
"leading-none": "line-height: 1",
|
|
101
|
+
"leading-tight": "line-height: 1.25",
|
|
102
|
+
"leading-snug": "line-height: 1.375",
|
|
103
|
+
"leading-normal": "line-height: 1.5",
|
|
104
|
+
"leading-relaxed": "line-height: 1.625",
|
|
105
|
+
"leading-loose": "line-height: 2",
|
|
108
106
|
// Text align.
|
|
109
|
-
"text-left":
|
|
110
|
-
"text-right":
|
|
111
|
-
"text-center":
|
|
112
|
-
"text-justify":
|
|
107
|
+
"text-left": "text-align: left",
|
|
108
|
+
"text-right": "text-align: right",
|
|
109
|
+
"text-center": "text-align: center",
|
|
110
|
+
"text-justify": "text-align: justify",
|
|
113
111
|
// Text decoration.
|
|
114
|
-
underline:
|
|
115
|
-
"no-underline":
|
|
116
|
-
"decoration-none":
|
|
117
|
-
"line-through":
|
|
112
|
+
underline: "text-decoration: underline",
|
|
113
|
+
"no-underline": "text-decoration: none",
|
|
114
|
+
"decoration-none": "text-decoration: none",
|
|
115
|
+
"line-through": "text-decoration: line-through",
|
|
118
116
|
// Text transform.
|
|
119
|
-
uppercase:
|
|
120
|
-
lowercase:
|
|
121
|
-
capitalize:
|
|
117
|
+
uppercase: "text-transform: uppercase",
|
|
118
|
+
lowercase: "text-transform: lowercase",
|
|
119
|
+
capitalize: "text-transform: capitalize",
|
|
122
120
|
// Text overflow.
|
|
123
|
-
truncate:
|
|
124
|
-
"text-elipsis":
|
|
125
|
-
"text-clip":
|
|
121
|
+
truncate: "white-space: nowrap; overflow: hidden; text-overflow: ellipsis",
|
|
122
|
+
"text-elipsis": "text-overflow: ellipsis",
|
|
123
|
+
"text-clip": "text-overflow: clip",
|
|
126
124
|
// Text wrap.
|
|
127
|
-
"text-wrap":
|
|
128
|
-
"text-nowrap":
|
|
129
|
-
"text-balance":
|
|
130
|
-
"text-pretty":
|
|
125
|
+
"text-wrap": "text-wrap: wrap",
|
|
126
|
+
"text-nowrap": "text-wrap: nowrap",
|
|
127
|
+
"text-balance": "text-wrap: balance",
|
|
128
|
+
"text-pretty": "text-wrap: pretty",
|
|
131
129
|
// Whitespace.
|
|
132
|
-
"whitespace-normal":
|
|
133
|
-
"whitespace-nowrap":
|
|
134
|
-
"whitespace-pre":
|
|
135
|
-
"whitespace-pre-line":
|
|
136
|
-
"whitespace-pre-wrap":
|
|
137
|
-
"whitespace-break-spaces":
|
|
130
|
+
"whitespace-normal": "white-space: normal",
|
|
131
|
+
"whitespace-nowrap": "white-space: nowrap",
|
|
132
|
+
"whitespace-pre": "white-space: pre",
|
|
133
|
+
"whitespace-pre-line": "white-space: pre-line",
|
|
134
|
+
"whitespace-pre-wrap": "white-space: pre-wrap",
|
|
135
|
+
"whitespace-break-spaces": "white-space: break-spaces",
|
|
138
136
|
// Position.
|
|
139
|
-
relative:
|
|
140
|
-
fixed:
|
|
141
|
-
absolute:
|
|
142
|
-
sticky:
|
|
137
|
+
relative: "position: relative",
|
|
138
|
+
fixed: "position: fixed",
|
|
139
|
+
absolute: "position: absolute",
|
|
140
|
+
sticky: "position: sticky",
|
|
143
141
|
// Object fit.
|
|
144
|
-
"object-contain":
|
|
145
|
-
"object-cover":
|
|
146
|
-
"object-fill":
|
|
147
|
-
"object-none":
|
|
142
|
+
"object-contain": "object-fit: contain",
|
|
143
|
+
"object-cover": "object-fit: cover",
|
|
144
|
+
"object-fill": "object-fit: fill",
|
|
145
|
+
"object-none": "object-fit: none",
|
|
148
146
|
// Display.
|
|
149
|
-
block:
|
|
150
|
-
contents:
|
|
151
|
-
hidden:
|
|
152
|
-
inline:
|
|
153
|
-
"inline-block":
|
|
147
|
+
block: "display: block",
|
|
148
|
+
contents: "display: contents",
|
|
149
|
+
hidden: "display: none",
|
|
150
|
+
inline: "display: inline",
|
|
151
|
+
"inline-block": "display: inline-block",
|
|
154
152
|
// Visibility.
|
|
155
|
-
visible:
|
|
156
|
-
invisible:
|
|
157
|
-
collapse:
|
|
153
|
+
visible: "visibility: visible",
|
|
154
|
+
invisible: "visibility: hidden",
|
|
155
|
+
collapse: "visibility: collapse",
|
|
158
156
|
// List style type.
|
|
159
|
-
"list-none":
|
|
160
|
-
"list-disc":
|
|
161
|
-
"list-decimal":
|
|
157
|
+
"list-none": "list-style-type: none",
|
|
158
|
+
"list-disc": "list-style-type: disc",
|
|
159
|
+
"list-decimal": "list-style-type: decimal",
|
|
162
160
|
// Flex.
|
|
163
|
-
flex:
|
|
164
|
-
grid:
|
|
165
|
-
"flex-1":
|
|
166
|
-
"flex-inline":
|
|
167
|
-
"flex-row":
|
|
168
|
-
"flex-col":
|
|
169
|
-
"flex-row-reverse":
|
|
170
|
-
"flex-col-reverse":
|
|
171
|
-
"flex-wrap":
|
|
172
|
-
"flex-wrap-reverse":
|
|
173
|
-
"flex-nowrap":
|
|
174
|
-
"justify-start":
|
|
175
|
-
"justify-end":
|
|
176
|
-
"justify-center":
|
|
177
|
-
"justify-between":
|
|
178
|
-
"justify-around":
|
|
179
|
-
"justify-evenly":
|
|
180
|
-
"justify-stretch":
|
|
181
|
-
"items-start":
|
|
182
|
-
"items-end":
|
|
183
|
-
"items-center":
|
|
184
|
-
"items-stretch":
|
|
185
|
-
"flex-grow":
|
|
186
|
-
"flex-shrink":
|
|
161
|
+
flex: "display: flex",
|
|
162
|
+
grid: "display: grid",
|
|
163
|
+
"flex-1": "flex: 1 1 0%",
|
|
164
|
+
"flex-inline": "display: inline-flex",
|
|
165
|
+
"flex-row": "flex-direction: row",
|
|
166
|
+
"flex-col": "flex-direction: column",
|
|
167
|
+
"flex-row-reverse": "flex-direction: row-reverse",
|
|
168
|
+
"flex-col-reverse": "flex-direction: column-reverse",
|
|
169
|
+
"flex-wrap": "flex-wrap: wrap",
|
|
170
|
+
"flex-wrap-reverse": "flex-wrap: wrap-reverse",
|
|
171
|
+
"flex-nowrap": "flex-wrap: nowrap",
|
|
172
|
+
"justify-start": "justify-content: flex-start",
|
|
173
|
+
"justify-end": "justify-content: flex-end",
|
|
174
|
+
"justify-center": "justify-content: center",
|
|
175
|
+
"justify-between": "justify-content: space-between",
|
|
176
|
+
"justify-around": "justify-content: space-around",
|
|
177
|
+
"justify-evenly": "justify-content: space-evenly",
|
|
178
|
+
"justify-stretch": "justify-content: stretch",
|
|
179
|
+
"items-start": "align-items: flex-start",
|
|
180
|
+
"items-end": "align-items: flex-end",
|
|
181
|
+
"items-center": "align-items: center",
|
|
182
|
+
"items-stretch": "align-items: stretch",
|
|
183
|
+
"flex-grow": "flex-grow: 1",
|
|
184
|
+
"flex-shrink": "flex-shrink: 1",
|
|
187
185
|
// Vertical alignment.
|
|
188
|
-
"align-baseline":
|
|
189
|
-
"align-top":
|
|
190
|
-
"align-middle":
|
|
191
|
-
"align-bottom":
|
|
192
|
-
"align-text-top":
|
|
193
|
-
"align-text-bottom":
|
|
186
|
+
"align-baseline": "vertical-align: baseline",
|
|
187
|
+
"align-top": "vertical-align: top",
|
|
188
|
+
"align-middle": "vertical-align: middle",
|
|
189
|
+
"align-bottom": "vertical-align: bottom",
|
|
190
|
+
"align-text-top": "vertical-align: text-top",
|
|
191
|
+
"align-text-bottom": "vertical-align: text-bottom",
|
|
194
192
|
// Overflow.
|
|
195
|
-
"overflow-auto":
|
|
196
|
-
"overflow-x-auto":
|
|
197
|
-
"overflow-y-auto":
|
|
198
|
-
"overflow-hidden":
|
|
199
|
-
"overflow-x-hidden":
|
|
200
|
-
"overflow-y-hidden":
|
|
201
|
-
"overflow-visible":
|
|
193
|
+
"overflow-auto": "overflow: auto",
|
|
194
|
+
"overflow-x-auto": "overflow-x: auto",
|
|
195
|
+
"overflow-y-auto": "overflow-y: auto",
|
|
196
|
+
"overflow-hidden": "overflow: hidden",
|
|
197
|
+
"overflow-x-hidden": "overflow-x: hidden",
|
|
198
|
+
"overflow-y-hidden": "overflow-y: hidden",
|
|
199
|
+
"overflow-visible": "overflow: visible",
|
|
202
200
|
// Overscroll.
|
|
203
|
-
"overscroll-auto":
|
|
204
|
-
"overscroll-contain":
|
|
205
|
-
"overscroll-none":
|
|
206
|
-
"overscroll-x-auto":
|
|
207
|
-
"overscroll-x-contain":
|
|
208
|
-
"overscroll-x-none":
|
|
209
|
-
"overscroll-y-auto":
|
|
210
|
-
"overscroll-y-contain":
|
|
211
|
-
"overscroll-y-none":
|
|
201
|
+
"overscroll-auto": "overscroll-behavior: auto",
|
|
202
|
+
"overscroll-contain": "overscroll-behavior: contain",
|
|
203
|
+
"overscroll-none": "overscroll-behavior: none",
|
|
204
|
+
"overscroll-x-auto": "overscroll-behavior-x: auto",
|
|
205
|
+
"overscroll-x-contain": "overscroll-behavior-x: contain",
|
|
206
|
+
"overscroll-x-none": "overscroll-behavior-x: none",
|
|
207
|
+
"overscroll-y-auto": "overscroll-behavior-y: auto",
|
|
208
|
+
"overscroll-y-contain": "overscroll-behavior-y: contain",
|
|
209
|
+
"overscroll-y-none": "overscroll-behavior-y: none",
|
|
212
210
|
// Z-index.
|
|
213
|
-
"z-auto":
|
|
211
|
+
"z-auto": "z-index: auto",
|
|
214
212
|
// Cursors.
|
|
215
|
-
"cursor-pointer":
|
|
216
|
-
"cursor-wait":
|
|
217
|
-
"cursor-not-allowed":
|
|
213
|
+
"cursor-pointer": "cursor: pointer",
|
|
214
|
+
"cursor-wait": "cursor: wait",
|
|
215
|
+
"cursor-not-allowed": "cursor: not-allowed",
|
|
218
216
|
// User selection.
|
|
219
|
-
"select-none":
|
|
220
|
-
"select-all":
|
|
217
|
+
"select-none": "user-select: none",
|
|
218
|
+
"select-all": "user-select: all",
|
|
221
219
|
// Events.
|
|
222
|
-
"pointer-events-auto":
|
|
223
|
-
"pointer-events-none":
|
|
220
|
+
"pointer-events-auto": "pointer-events: auto",
|
|
221
|
+
"pointer-events-none": "pointer-events: none",
|
|
224
222
|
// Sizing.
|
|
225
|
-
"box-border":
|
|
226
|
-
"box-content":
|
|
223
|
+
"box-border": "box-sizing: border-box",
|
|
224
|
+
"box-content": "box-sizing: content-box",
|
|
227
225
|
// Resizing.
|
|
228
|
-
resize:
|
|
229
|
-
"resize-x":
|
|
230
|
-
"resize-y":
|
|
231
|
-
"resize-none":
|
|
226
|
+
resize: "resize: both",
|
|
227
|
+
"resize-x": "resize: horizontal",
|
|
228
|
+
"resize-y": "resize: vertical",
|
|
229
|
+
"resize-none": "resize: none",
|
|
232
230
|
// Appearance.
|
|
233
|
-
"appearance-none":
|
|
234
|
-
appearance: "none",
|
|
235
|
-
"-webkit-appearance": "none",
|
|
236
|
-
"-moz-appearance": "none",
|
|
237
|
-
},
|
|
231
|
+
"appearance-none": "appearance: none; -webkit-appearance: none; -moz-appearance: none",
|
|
238
232
|
// Borders.
|
|
239
|
-
border:
|
|
240
|
-
"border-none":
|
|
241
|
-
"border-solid":
|
|
242
|
-
"border-dashed":
|
|
243
|
-
"border-dotted":
|
|
244
|
-
"border-collapse":
|
|
233
|
+
border: "border: 1px solid",
|
|
234
|
+
"border-none": "border: none",
|
|
235
|
+
"border-solid": "border-style: solid",
|
|
236
|
+
"border-dashed": "border-style: dashed",
|
|
237
|
+
"border-dotted": "border-style: dotted",
|
|
238
|
+
"border-collapse": "border-collapse: collapse",
|
|
245
239
|
// Radius.
|
|
246
|
-
"rounded-none":
|
|
247
|
-
rounded:
|
|
248
|
-
"rounded-sm":
|
|
249
|
-
"rounded-md":
|
|
250
|
-
"rounded-lg":
|
|
251
|
-
"rounded-xl":
|
|
252
|
-
"rounded-full":
|
|
240
|
+
"rounded-none": "border-radius: 0",
|
|
241
|
+
rounded: "border-radius: .25rem",
|
|
242
|
+
"rounded-sm": "border-radius: .125rem",
|
|
243
|
+
"rounded-md": "border-radius: .375rem",
|
|
244
|
+
"rounded-lg": "border-radius: .5rem",
|
|
245
|
+
"rounded-xl": "border-radius: .75rem",
|
|
246
|
+
"rounded-full": "border-radius: 9999px",
|
|
253
247
|
// Shadows (matching Tailwind CSS).
|
|
254
|
-
"shadow-2xs":
|
|
255
|
-
"shadow-xs":
|
|
256
|
-
shadow:
|
|
257
|
-
"shadow-sm":
|
|
258
|
-
"shadow-md":
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
"shadow-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
"shadow-xl": {
|
|
265
|
-
"box-shadow": "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
266
|
-
},
|
|
267
|
-
"shadow-2xl": { "box-shadow": "0 25px 50px -12px rgb(0 0 0 / 0.25)" },
|
|
268
|
-
"shadow-inner": { "box-shadow": "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)" },
|
|
269
|
-
"shadow-none": { "box-shadow": "0 0 #0000" },
|
|
248
|
+
"shadow-2xs": "box-shadow: 0 1px rgb(0 0 0 / 0.05)",
|
|
249
|
+
"shadow-xs": "box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
250
|
+
shadow: "box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
251
|
+
"shadow-sm": "box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
252
|
+
"shadow-md": "box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
253
|
+
"shadow-lg": "box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
254
|
+
"shadow-xl": "box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
255
|
+
"shadow-2xl": "box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
256
|
+
"shadow-inner": "box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
257
|
+
"shadow-none": "box-shadow: 0 0 #0000",
|
|
270
258
|
// Ring utilities for focus states.
|
|
271
|
-
ring:
|
|
272
|
-
"ring-0":
|
|
273
|
-
"ring-1":
|
|
274
|
-
"ring-2":
|
|
275
|
-
"ring-4":
|
|
276
|
-
"ring-8":
|
|
277
|
-
"ring-inset":
|
|
259
|
+
ring: "box-shadow: var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)",
|
|
260
|
+
"ring-0": "box-shadow: var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)",
|
|
261
|
+
"ring-1": "box-shadow: var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)",
|
|
262
|
+
"ring-2": "box-shadow: var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)",
|
|
263
|
+
"ring-4": "box-shadow: var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)",
|
|
264
|
+
"ring-8": "box-shadow: var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)",
|
|
265
|
+
"ring-inset": "--ring-inset: inset",
|
|
278
266
|
// Outline utilities.
|
|
279
|
-
outline:
|
|
280
|
-
"outline-none":
|
|
281
|
-
"outline-dashed":
|
|
282
|
-
"outline-dotted":
|
|
283
|
-
"outline-double":
|
|
284
|
-
"outline-0":
|
|
285
|
-
"outline-1":
|
|
286
|
-
"outline-2":
|
|
287
|
-
"outline-4":
|
|
288
|
-
"outline-8":
|
|
289
|
-
"outline-offset-0":
|
|
290
|
-
"outline-offset-1":
|
|
291
|
-
"outline-offset-2":
|
|
292
|
-
"outline-offset-4":
|
|
293
|
-
"outline-offset-8":
|
|
267
|
+
outline: "outline-style: solid",
|
|
268
|
+
"outline-none": "outline: 2px solid transparent; outline-offset: 2px",
|
|
269
|
+
"outline-dashed": "outline-style: dashed",
|
|
270
|
+
"outline-dotted": "outline-style: dotted",
|
|
271
|
+
"outline-double": "outline-style: double",
|
|
272
|
+
"outline-0": "outline-width: 0px",
|
|
273
|
+
"outline-1": "outline-width: 1px",
|
|
274
|
+
"outline-2": "outline-width: 2px",
|
|
275
|
+
"outline-4": "outline-width: 4px",
|
|
276
|
+
"outline-8": "outline-width: 8px",
|
|
277
|
+
"outline-offset-0": "outline-offset: 0px",
|
|
278
|
+
"outline-offset-1": "outline-offset: 1px",
|
|
279
|
+
"outline-offset-2": "outline-offset: 2px",
|
|
280
|
+
"outline-offset-4": "outline-offset: 4px",
|
|
281
|
+
"outline-offset-8": "outline-offset: 8px",
|
|
294
282
|
// Aspect ratio utilities.
|
|
295
|
-
"aspect-auto":
|
|
296
|
-
"aspect-square":
|
|
297
|
-
"aspect-video":
|
|
283
|
+
"aspect-auto": "aspect-ratio: auto",
|
|
284
|
+
"aspect-square": "aspect-ratio: 1 / 1",
|
|
285
|
+
"aspect-video": "aspect-ratio: 16 / 9",
|
|
298
286
|
// Backdrop filter utilities.
|
|
299
|
-
"backdrop-blur-none":
|
|
300
|
-
"backdrop-blur-sm":
|
|
301
|
-
"backdrop-blur":
|
|
302
|
-
"backdrop-blur-md":
|
|
303
|
-
"backdrop-blur-lg":
|
|
304
|
-
"backdrop-blur-xl":
|
|
305
|
-
"backdrop-blur-2xl":
|
|
306
|
-
"backdrop-blur-3xl":
|
|
287
|
+
"backdrop-blur-none": "backdrop-filter: blur(0)",
|
|
288
|
+
"backdrop-blur-sm": "backdrop-filter: blur(4px)",
|
|
289
|
+
"backdrop-blur": "backdrop-filter: blur(8px)",
|
|
290
|
+
"backdrop-blur-md": "backdrop-filter: blur(12px)",
|
|
291
|
+
"backdrop-blur-lg": "backdrop-filter: blur(16px)",
|
|
292
|
+
"backdrop-blur-xl": "backdrop-filter: blur(24px)",
|
|
293
|
+
"backdrop-blur-2xl": "backdrop-filter: blur(40px)",
|
|
294
|
+
"backdrop-blur-3xl": "backdrop-filter: blur(64px)",
|
|
307
295
|
// Transitions.
|
|
308
|
-
"transition-none":
|
|
309
|
-
transition:
|
|
296
|
+
"transition-none": "transition: none",
|
|
297
|
+
transition: `transition-property: all; ${TRANSITION_BASE}`,
|
|
310
298
|
// Per-property helpers mirroring Tailwind's transition-property utilities.
|
|
311
|
-
"transition-all":
|
|
312
|
-
"transition-opacity":
|
|
313
|
-
"transition-transform":
|
|
314
|
-
"transition-shadow":
|
|
315
|
-
"transition-colors": {
|
|
316
|
-
"transition-property": "color, background-color, border-color, text-decoration-color, fill, stroke",
|
|
317
|
-
...TRANSITION_BASE,
|
|
318
|
-
},
|
|
299
|
+
"transition-all": `transition-property: all; ${TRANSITION_BASE}`,
|
|
300
|
+
"transition-opacity": `transition-property: opacity; ${TRANSITION_BASE}`,
|
|
301
|
+
"transition-transform": `transition-property: transform; ${TRANSITION_BASE}`,
|
|
302
|
+
"transition-shadow": `transition-property: box-shadow; ${TRANSITION_BASE}`,
|
|
303
|
+
"transition-colors": `transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; ${TRANSITION_BASE}`,
|
|
319
304
|
// Animations.
|
|
320
|
-
"animate-none":
|
|
321
|
-
"animate-spin":
|
|
322
|
-
"animate-ping":
|
|
323
|
-
"animate-pulse":
|
|
305
|
+
"animate-none": "animation: none",
|
|
306
|
+
"animate-spin": "animation: spin 1s linear infinite",
|
|
307
|
+
"animate-ping": "animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",
|
|
308
|
+
"animate-pulse": "animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
|
|
324
309
|
// Backgrounds.
|
|
325
|
-
"bg-auto":
|
|
326
|
-
"bg-cover":
|
|
327
|
-
"bg-contain":
|
|
328
|
-
"bg-center":
|
|
329
|
-
"bg-top":
|
|
330
|
-
"bg-bottom":
|
|
331
|
-
"bg-left":
|
|
332
|
-
"bg-right":
|
|
333
|
-
"bg-left-top":
|
|
334
|
-
"bg-left-bottom":
|
|
335
|
-
"bg-right-top":
|
|
336
|
-
"bg-right-bottom":
|
|
337
|
-
"bg-no-repeat":
|
|
338
|
-
"bg-fixed":
|
|
339
|
-
"bg-local":
|
|
340
|
-
"bg-scroll":
|
|
310
|
+
"bg-auto": "background-size: auto",
|
|
311
|
+
"bg-cover": "background-size: cover",
|
|
312
|
+
"bg-contain": "background-size: contain",
|
|
313
|
+
"bg-center": "background-position: center",
|
|
314
|
+
"bg-top": "background-position: top",
|
|
315
|
+
"bg-bottom": "background-position: bottom",
|
|
316
|
+
"bg-left": "background-position: left",
|
|
317
|
+
"bg-right": "background-position: right",
|
|
318
|
+
"bg-left-top": "background-position: left top",
|
|
319
|
+
"bg-left-bottom": "background-position: left bottom",
|
|
320
|
+
"bg-right-top": "background-position: right top",
|
|
321
|
+
"bg-right-bottom": "background-position: right bottom",
|
|
322
|
+
"bg-no-repeat": "background-repeat: no-repeat",
|
|
323
|
+
"bg-fixed": "background-attachment: fixed",
|
|
324
|
+
"bg-local": "background-attachment: local",
|
|
325
|
+
"bg-scroll": "background-attachment: scroll",
|
|
341
326
|
// Screen/viewport sizing.
|
|
342
|
-
"min-h-screen":
|
|
343
|
-
"max-h-screen":
|
|
344
|
-
"min-w-screen":
|
|
345
|
-
"h-dvh":
|
|
346
|
-
"h-svh":
|
|
347
|
-
"h-lvh":
|
|
348
|
-
"w-dvw":
|
|
349
|
-
"w-svw":
|
|
350
|
-
"w-lvw":
|
|
351
|
-
"min-h-dvh":
|
|
352
|
-
"min-h-svh":
|
|
353
|
-
"min-h-lvh":
|
|
327
|
+
"min-h-screen": "min-height: 100vh",
|
|
328
|
+
"max-h-screen": "max-height: 100vh",
|
|
329
|
+
"min-w-screen": "min-width: 100vw",
|
|
330
|
+
"h-dvh": "height: 100dvh",
|
|
331
|
+
"h-svh": "height: 100svh",
|
|
332
|
+
"h-lvh": "height: 100lvh",
|
|
333
|
+
"w-dvw": "width: 100dvw",
|
|
334
|
+
"w-svw": "width: 100svw",
|
|
335
|
+
"w-lvw": "width: 100lvw",
|
|
336
|
+
"min-h-dvh": "min-height: 100dvh",
|
|
337
|
+
"min-h-svh": "min-height: 100svh",
|
|
338
|
+
"min-h-lvh": "min-height: 100lvh",
|
|
354
339
|
// Flexbox enhancements.
|
|
355
|
-
"flex-none":
|
|
356
|
-
"flex-auto":
|
|
357
|
-
"flex-initial":
|
|
358
|
-
grow:
|
|
359
|
-
"grow-0":
|
|
360
|
-
shrink:
|
|
361
|
-
"shrink-0":
|
|
362
|
-
"self-auto":
|
|
363
|
-
"self-start":
|
|
364
|
-
"self-end":
|
|
365
|
-
"self-center":
|
|
366
|
-
"self-stretch":
|
|
367
|
-
"self-baseline":
|
|
368
|
-
"content-normal":
|
|
369
|
-
"content-start":
|
|
370
|
-
"content-end":
|
|
371
|
-
"content-center":
|
|
372
|
-
"content-between":
|
|
373
|
-
"content-around":
|
|
374
|
-
"content-evenly":
|
|
375
|
-
"content-stretch":
|
|
376
|
-
"items-baseline":
|
|
340
|
+
"flex-none": "flex: none",
|
|
341
|
+
"flex-auto": "flex: 1 1 auto",
|
|
342
|
+
"flex-initial": "flex: 0 1 auto",
|
|
343
|
+
grow: "flex-grow: 1",
|
|
344
|
+
"grow-0": "flex-grow: 0",
|
|
345
|
+
shrink: "flex-shrink: 1",
|
|
346
|
+
"shrink-0": "flex-shrink: 0",
|
|
347
|
+
"self-auto": "align-self: auto",
|
|
348
|
+
"self-start": "align-self: flex-start",
|
|
349
|
+
"self-end": "align-self: flex-end",
|
|
350
|
+
"self-center": "align-self: center",
|
|
351
|
+
"self-stretch": "align-self: stretch",
|
|
352
|
+
"self-baseline": "align-self: baseline",
|
|
353
|
+
"content-normal": "align-content: normal",
|
|
354
|
+
"content-start": "align-content: flex-start",
|
|
355
|
+
"content-end": "align-content: flex-end",
|
|
356
|
+
"content-center": "align-content: center",
|
|
357
|
+
"content-between": "align-content: space-between",
|
|
358
|
+
"content-around": "align-content: space-around",
|
|
359
|
+
"content-evenly": "align-content: space-evenly",
|
|
360
|
+
"content-stretch": "align-content: stretch",
|
|
361
|
+
"items-baseline": "align-items: baseline",
|
|
377
362
|
// Inset utilities.
|
|
378
|
-
"inset-0":
|
|
379
|
-
"inset-auto":
|
|
380
|
-
"inset-x-0":
|
|
381
|
-
"inset-y-0":
|
|
382
|
-
"inset-x-auto":
|
|
383
|
-
"inset-y-auto":
|
|
363
|
+
"inset-0": "inset: 0",
|
|
364
|
+
"inset-auto": "inset: auto",
|
|
365
|
+
"inset-x-0": "left: 0; right: 0",
|
|
366
|
+
"inset-y-0": "top: 0; bottom: 0",
|
|
367
|
+
"inset-x-auto": "left: auto; right: auto",
|
|
368
|
+
"inset-y-auto": "top: auto; bottom: auto",
|
|
384
369
|
// Accessibility.
|
|
385
|
-
"sr-only":
|
|
386
|
-
|
|
387
|
-
width: "1px",
|
|
388
|
-
height: "1px",
|
|
389
|
-
padding: "0",
|
|
390
|
-
margin: "-1px",
|
|
391
|
-
overflow: "hidden",
|
|
392
|
-
clip: "rect(0, 0, 0, 0)",
|
|
393
|
-
"white-space": "nowrap",
|
|
394
|
-
"border-width": "0",
|
|
395
|
-
},
|
|
396
|
-
"not-sr-only": {
|
|
397
|
-
position: "static",
|
|
398
|
-
width: "auto",
|
|
399
|
-
height: "auto",
|
|
400
|
-
padding: "0",
|
|
401
|
-
margin: "0",
|
|
402
|
-
overflow: "visible",
|
|
403
|
-
clip: "auto",
|
|
404
|
-
"white-space": "normal",
|
|
405
|
-
},
|
|
370
|
+
"sr-only": "position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0",
|
|
371
|
+
"not-sr-only": "position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal",
|
|
406
372
|
};
|
|
373
|
+
// Emitted verbatim, so they carry no indentation: every other rule this module
|
|
374
|
+
// produces is minified, and these ship in the same stylesheet.
|
|
407
375
|
const PROPS_AS_IS = [
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}`,
|
|
412
|
-
`@keyframes ping {
|
|
413
|
-
75%, 100% {
|
|
414
|
-
transform: scale(2);
|
|
415
|
-
opacity: 0;
|
|
416
|
-
}
|
|
417
|
-
}`,
|
|
418
|
-
`@keyframes pulse {
|
|
419
|
-
0%, 100% { opacity: 1 }
|
|
420
|
-
50% { opacity: .5 }
|
|
421
|
-
}`,
|
|
376
|
+
"@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}",
|
|
377
|
+
"@keyframes ping{75%,100%{transform:scale(2);opacity:0}}",
|
|
378
|
+
"@keyframes pulse{0%,100%{opacity:1}50%{opacity:.5}}",
|
|
422
379
|
];
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
400: "#ec407a",
|
|
442
|
-
500: "#e91e63",
|
|
443
|
-
600: "#d81b60",
|
|
444
|
-
700: "#c2185b",
|
|
445
|
-
800: "#ad1457",
|
|
446
|
-
900: "#880e4f",
|
|
447
|
-
},
|
|
448
|
-
purple: {
|
|
449
|
-
50: "#f3e5f5",
|
|
450
|
-
100: "#e1bee7",
|
|
451
|
-
200: "#ce93d8",
|
|
452
|
-
300: "#ba68c8",
|
|
453
|
-
400: "#ab47bc",
|
|
454
|
-
500: "#9c27b0",
|
|
455
|
-
600: "#8e24aa",
|
|
456
|
-
700: "#7b1fa2",
|
|
457
|
-
800: "#6a1b9a",
|
|
458
|
-
900: "#4a148c",
|
|
459
|
-
},
|
|
460
|
-
"deep-purple": {
|
|
461
|
-
50: "#ede7f6",
|
|
462
|
-
100: "#d1c4e9",
|
|
463
|
-
200: "#b39ddb",
|
|
464
|
-
300: "#9575cd",
|
|
465
|
-
400: "#7e57c2",
|
|
466
|
-
500: "#673ab7",
|
|
467
|
-
600: "#5e35b1",
|
|
468
|
-
700: "#512da8",
|
|
469
|
-
800: "#4527a0",
|
|
470
|
-
900: "#311b92",
|
|
471
|
-
},
|
|
472
|
-
indigo: {
|
|
473
|
-
50: "#e8eaf6",
|
|
474
|
-
100: "#c5cae9",
|
|
475
|
-
200: "#9fa8da",
|
|
476
|
-
300: "#7986cb",
|
|
477
|
-
400: "#5c6bc0",
|
|
478
|
-
500: "#3f51b5",
|
|
479
|
-
600: "#3949ab",
|
|
480
|
-
700: "#303f9f",
|
|
481
|
-
800: "#283593",
|
|
482
|
-
900: "#1a237e",
|
|
483
|
-
},
|
|
484
|
-
blue: {
|
|
485
|
-
50: "#e3f2fd",
|
|
486
|
-
100: "#bbdefb",
|
|
487
|
-
200: "#90caf9",
|
|
488
|
-
300: "#64b5f6",
|
|
489
|
-
400: "#42a5f5",
|
|
490
|
-
500: "#2196f3",
|
|
491
|
-
600: "#1e88e5",
|
|
492
|
-
700: "#1976d2",
|
|
493
|
-
800: "#1565c0",
|
|
494
|
-
900: "#0d47a1",
|
|
495
|
-
},
|
|
496
|
-
"light-blue": {
|
|
497
|
-
50: "#e1f5fe",
|
|
498
|
-
100: "#b3e5fc",
|
|
499
|
-
200: "#81d4fa",
|
|
500
|
-
300: "#4fc3f7",
|
|
501
|
-
400: "#29b6f6",
|
|
502
|
-
500: "#03a9f4",
|
|
503
|
-
600: "#039be5",
|
|
504
|
-
700: "#0288d1",
|
|
505
|
-
800: "#0277bd",
|
|
506
|
-
900: "#01579b",
|
|
507
|
-
},
|
|
508
|
-
cyan: {
|
|
509
|
-
50: "#e0f7fa",
|
|
510
|
-
100: "#b2ebf2",
|
|
511
|
-
200: "#80deea",
|
|
512
|
-
300: "#4dd0e1",
|
|
513
|
-
400: "#26c6da",
|
|
514
|
-
500: "#00bcd4",
|
|
515
|
-
600: "#00acc1",
|
|
516
|
-
700: "#0097a7",
|
|
517
|
-
800: "#00838f",
|
|
518
|
-
900: "#006064",
|
|
519
|
-
},
|
|
520
|
-
teal: {
|
|
521
|
-
50: "#e0f2f1",
|
|
522
|
-
100: "#b2dfdb",
|
|
523
|
-
200: "#80cbc4",
|
|
524
|
-
300: "#4db6ac",
|
|
525
|
-
400: "#26a69a",
|
|
526
|
-
500: "#009688",
|
|
527
|
-
600: "#00897b",
|
|
528
|
-
700: "#00796b",
|
|
529
|
-
800: "#00695c",
|
|
530
|
-
900: "#004d40",
|
|
531
|
-
},
|
|
532
|
-
green: {
|
|
533
|
-
50: "#e8f5e9",
|
|
534
|
-
100: "#c8e6c9",
|
|
535
|
-
200: "#a5d6a7",
|
|
536
|
-
300: "#81c784",
|
|
537
|
-
400: "#66bb6a",
|
|
538
|
-
500: "#4caf50",
|
|
539
|
-
600: "#43a047",
|
|
540
|
-
700: "#388e3c",
|
|
541
|
-
800: "#2e7d32",
|
|
542
|
-
900: "#1b5e20",
|
|
543
|
-
},
|
|
544
|
-
"light-green": {
|
|
545
|
-
50: "#f1f8e9",
|
|
546
|
-
100: "#dcedc8",
|
|
547
|
-
200: "#c5e1a5",
|
|
548
|
-
300: "#aed581",
|
|
549
|
-
400: "#9ccc65",
|
|
550
|
-
500: "#8bc34a",
|
|
551
|
-
600: "#7cb342",
|
|
552
|
-
700: "#689f38",
|
|
553
|
-
800: "#558b2f",
|
|
554
|
-
900: "#33691e",
|
|
555
|
-
},
|
|
556
|
-
lime: {
|
|
557
|
-
50: "#f9fbe7",
|
|
558
|
-
100: "#f0f4c3",
|
|
559
|
-
200: "#e6ee9c",
|
|
560
|
-
300: "#dce775",
|
|
561
|
-
400: "#d4e157",
|
|
562
|
-
500: "#cddc39",
|
|
563
|
-
600: "#c0ca33",
|
|
564
|
-
700: "#afb42b",
|
|
565
|
-
800: "#9e9d24",
|
|
566
|
-
900: "#827717",
|
|
567
|
-
},
|
|
568
|
-
yellow: {
|
|
569
|
-
50: "#fffde7",
|
|
570
|
-
100: "#fff9c4",
|
|
571
|
-
200: "#fff59d",
|
|
572
|
-
300: "#fff176",
|
|
573
|
-
400: "#ffee58",
|
|
574
|
-
500: "#ffeb3b",
|
|
575
|
-
600: "#fdd835",
|
|
576
|
-
700: "#fbc02d",
|
|
577
|
-
800: "#f9a825",
|
|
578
|
-
900: "#f57f17",
|
|
579
|
-
},
|
|
580
|
-
amber: {
|
|
581
|
-
50: "#fff8e1",
|
|
582
|
-
100: "#ffecb3",
|
|
583
|
-
200: "#ffe082",
|
|
584
|
-
300: "#ffd54f",
|
|
585
|
-
400: "#ffca28",
|
|
586
|
-
500: "#ffc107",
|
|
587
|
-
600: "#ffb300",
|
|
588
|
-
700: "#ffa000",
|
|
589
|
-
800: "#ff8f00",
|
|
590
|
-
900: "#ff6f00",
|
|
591
|
-
},
|
|
592
|
-
orange: {
|
|
593
|
-
50: "#fff3e0",
|
|
594
|
-
100: "#ffe0b2",
|
|
595
|
-
200: "#ffcc80",
|
|
596
|
-
300: "#ffb74d",
|
|
597
|
-
400: "#ffa726",
|
|
598
|
-
500: "#ff9800",
|
|
599
|
-
600: "#fb8c00",
|
|
600
|
-
700: "#f57c00",
|
|
601
|
-
800: "#ef6c00",
|
|
602
|
-
900: "#e65100",
|
|
603
|
-
},
|
|
604
|
-
"deep-orange": {
|
|
605
|
-
50: "#fbe9e7",
|
|
606
|
-
100: "#ffccbc",
|
|
607
|
-
200: "#ffab91",
|
|
608
|
-
300: "#ff8a65",
|
|
609
|
-
400: "#ff7043",
|
|
610
|
-
500: "#ff5722",
|
|
611
|
-
600: "#f4511e",
|
|
612
|
-
700: "#e64a19",
|
|
613
|
-
800: "#d84315",
|
|
614
|
-
900: "#bf360c",
|
|
615
|
-
},
|
|
616
|
-
brown: {
|
|
617
|
-
50: "#efebe9",
|
|
618
|
-
100: "#d7ccc8",
|
|
619
|
-
200: "#bcaaa4",
|
|
620
|
-
300: "#a1887f",
|
|
621
|
-
400: "#8d6e63",
|
|
622
|
-
500: "#795548",
|
|
623
|
-
600: "#6d4c41",
|
|
624
|
-
700: "#5d4037",
|
|
625
|
-
800: "#4e342e",
|
|
626
|
-
900: "#3e2723",
|
|
627
|
-
},
|
|
628
|
-
gray: {
|
|
629
|
-
50: "#fafafa",
|
|
630
|
-
100: "#f5f5f5",
|
|
631
|
-
200: "#eeeeee",
|
|
632
|
-
300: "#e0e0e0",
|
|
633
|
-
400: "#bdbdbd",
|
|
634
|
-
500: "#9e9e9e",
|
|
635
|
-
600: "#757575",
|
|
636
|
-
700: "#616161",
|
|
637
|
-
800: "#424242",
|
|
638
|
-
900: "#212121",
|
|
639
|
-
},
|
|
640
|
-
"blue-gray": {
|
|
641
|
-
50: "#eceff1",
|
|
642
|
-
100: "#cfd8dc",
|
|
643
|
-
200: "#b0bec5",
|
|
644
|
-
300: "#90a4ae",
|
|
645
|
-
400: "#78909c",
|
|
646
|
-
500: "#607d8b",
|
|
647
|
-
600: "#546e7a",
|
|
648
|
-
700: "#455a64",
|
|
649
|
-
800: "#37474f",
|
|
650
|
-
900: "#263238",
|
|
651
|
-
},
|
|
652
|
-
};
|
|
380
|
+
/**
|
|
381
|
+
* The Material palette. Every hue carries the same ten shades, so the table is
|
|
382
|
+
* stored as three flat pieces — hue names, shade stops, and one run of 6-digit
|
|
383
|
+
* hex — instead of 19 nested objects that repeat the same keys. Written out, the
|
|
384
|
+
* repeated syntax costs roughly a tenth of the compressed bundle for data that
|
|
385
|
+
* never changes; packed, it costs the hex itself. Entry (hue i, shade j) lives
|
|
386
|
+
* at offset (i * 10 + j) * 6, which css_gen_utils.test.ts pins.
|
|
387
|
+
*/
|
|
388
|
+
const COLOR_NAMES = "red pink purple deep-purple indigo blue light-blue cyan teal green light-green lime yellow amber orange deep-orange brown gray blue-gray".split(" ");
|
|
389
|
+
const COLOR_SHADES = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
390
|
+
const COLOR_HEX = "ffebeeffcdd2ef9a9ae57373ef5350f44336e53935d32f2fc62828b71c1cfce4ecf8bbd0f48fb1f06292ec407ae91e63d81b60c2185bad1457880e4ff3e5f5e1bee7ce93d8ba68c8ab47bc9c27b08e24aa7b1fa26a1b9a4a148cede7f6d1c4e9b39ddb9575cd7e57c2673ab75e35b1512da84527a0311b92e8eaf6c5cae99fa8da7986cb5c6bc03f51b53949ab303f9f2835931a237ee3f2fdbbdefb90caf964b5f642a5f52196f31e88e51976d21565c00d47a1e1f5feb3e5fc81d4fa4fc3f729b6f603a9f4039be50288d10277bd01579be0f7fab2ebf280deea4dd0e126c6da00bcd400acc10097a700838f006064e0f2f1b2dfdb80cbc44db6ac26a69a00968800897b00796b00695c004d40e8f5e9c8e6c9a5d6a781c78466bb6a4caf5043a047388e3c2e7d321b5e20f1f8e9dcedc8c5e1a5aed5819ccc658bc34a7cb342689f38558b2f33691ef9fbe7f0f4c3e6ee9cdce775d4e157cddc39c0ca33afb42b9e9d24827717fffde7fff9c4fff59dfff176ffee58ffeb3bfdd835fbc02df9a825f57f17fff8e1ffecb3ffe082ffd54fffca28ffc107ffb300ffa000ff8f00ff6f00fff3e0ffe0b2ffcc80ffb74dffa726ff9800fb8c00f57c00ef6c00e65100fbe9e7ffccbcffab91ff8a65ff7043ff5722f4511ee64a19d84315bf360cefebe9d7ccc8bcaaa4a1887f8d6e637955486d4c415d40374e342e3e2723fafafaf5f5f5eeeeeee0e0e0bdbdbd9e9e9e757575616161424242212121eceff1cfd8dcb0bec590a4ae78909c607d8b546e7a455a6437474f263238";
|
|
391
|
+
export const PROPS_COLORS = Object.fromEntries(COLOR_NAMES.map((name, i) => [
|
|
392
|
+
name,
|
|
393
|
+
Object.fromEntries(COLOR_SHADES.map((shade, j) => {
|
|
394
|
+
const at = (i * COLOR_SHADES.length + j) * 6;
|
|
395
|
+
return [shade, `#${COLOR_HEX.slice(at, at + 6)}`];
|
|
396
|
+
})),
|
|
397
|
+
]));
|
|
653
398
|
// Pseudo-state and responsive variants are now generated on-demand by css_custom.ts.
|
|
654
399
|
function wrap(pairs) {
|
|
655
400
|
return pairs.map(([klass, rule]) => `.${klass} { ${rule} }`);
|
|
656
401
|
}
|
|
657
|
-
|
|
402
|
+
// Which value forms a property actually accepts. Negative lengths are legal for
|
|
403
|
+
// margins and positional offsets only; `auto` is legal everywhere except
|
|
404
|
+
// padding. Generating the rest anyway left rules the browser parsed and then
|
|
405
|
+
// discarded, so they cost bytes and matched nothing.
|
|
406
|
+
const SIGNS_ANY = ["", "-"];
|
|
407
|
+
const SIGNS_POSITIVE = [""];
|
|
408
|
+
/** Box sides, paired with the letter their utility classes use. */
|
|
409
|
+
const SIDES = [
|
|
410
|
+
["top", "t"],
|
|
411
|
+
["bottom", "b"],
|
|
412
|
+
["left", "l"],
|
|
413
|
+
["right", "r"],
|
|
414
|
+
];
|
|
415
|
+
/**
|
|
416
|
+
* The rem / pixel / percentage triple that every length utility offers.
|
|
417
|
+
* `sign` prefixes both the class and the value, so a negative class carries a
|
|
418
|
+
* negative length.
|
|
419
|
+
*/
|
|
420
|
+
function scaled(sign, klass, decl) {
|
|
421
|
+
const at = (suffix, value) => [
|
|
422
|
+
`${sign}${klass(suffix)}`,
|
|
423
|
+
decl(`${sign}${value}`),
|
|
424
|
+
];
|
|
425
|
+
return [
|
|
426
|
+
...UNITS_ALL.map((v) => at(`${v}`, `${v * REM_UNIT}rem`)),
|
|
427
|
+
...UNITS_ALL.map((v) => at(`${v}px`, `${v}px`)),
|
|
428
|
+
...PERCENTS.map((v) => at(`${v}\\%`, `${v}%`)),
|
|
429
|
+
];
|
|
430
|
+
}
|
|
431
|
+
function posneg(props, signs = SIGNS_ANY) {
|
|
658
432
|
return wrap(Object.entries(props).flatMap(([prop, klass]) => [
|
|
659
433
|
[`${klass}-0`, `${prop}: 0`],
|
|
660
434
|
[`${klass}-screen`, `${prop}: 100v${prop.includes("height") ? "h" : "w"}`],
|
|
661
435
|
[`${klass}-full`, `${prop}: 100%`],
|
|
662
|
-
...
|
|
663
|
-
...UNITS_ALL.map((v) => [`-${klass}-${v}`, `${prop}: -${v * REM_UNIT}rem`]),
|
|
664
|
-
...UNITS_ALL.map((v) => [`${klass}-${v}px`, `${prop}: ${v}px`]),
|
|
665
|
-
...UNITS_ALL.map((v) => [`-${klass}-${v}px`, `${prop}: -${v}px`]),
|
|
666
|
-
...PERCENTS.map((v) => [`${klass}-${v}\\%`, `${prop}: ${v}%`]),
|
|
667
|
-
...PERCENTS.map((v) => [`-${klass}-${v}\\%`, `${prop}: -${v}%`]),
|
|
436
|
+
...signs.flatMap((sign) => scaled(sign, (s) => `${klass}-${s}`, (v) => `${prop}: ${v}`)),
|
|
668
437
|
...MEDIA_ENTRIES.map(([bp, width]) => [`${klass}-${bp}`, `${prop}: ${width}px`]),
|
|
669
438
|
]));
|
|
670
439
|
}
|
|
671
|
-
|
|
440
|
+
/** `auto` shorthand, for properties that accept it. */
|
|
441
|
+
function autoShorthand(props) {
|
|
442
|
+
return wrap(Object.entries(props).map(([prop, klass]) => [`${klass}-auto`, `${prop}: auto`]));
|
|
443
|
+
}
|
|
444
|
+
/** `auto` on each axis and side, for properties with longhands that accept it. */
|
|
445
|
+
function autoSides(props) {
|
|
672
446
|
return wrap(Object.entries(props).flatMap(([prop, klass]) => [
|
|
673
|
-
[`${klass}-auto`, `${prop}: auto`],
|
|
674
447
|
[`${klass}x-auto`, `${prop}-left: auto; ${prop}-right: auto;`],
|
|
675
448
|
[`${klass}y-auto`, `${prop}-top: auto; ${prop}-bottom: auto;`],
|
|
449
|
+
...SIDES.map(([side, letter]) => [`${klass}${letter}-auto`, `${prop}-${side}: auto`]),
|
|
450
|
+
]));
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Axis (x/y) split, for properties with -left/-right/-top/-bottom longhands.
|
|
454
|
+
* Width and height have none, so they are not eligible.
|
|
455
|
+
*/
|
|
456
|
+
function axis(props) {
|
|
457
|
+
return wrap(Object.entries(props).flatMap(([prop, klass]) => [
|
|
676
458
|
[`${klass}x-0`, `${prop}-left: 0; ${prop}-right: 0;`],
|
|
677
459
|
[`${klass}y-0`, `${prop}-top: 0; ${prop}-bottom: 0;`],
|
|
678
|
-
...
|
|
679
|
-
|
|
680
|
-
`${prop}-left: ${v * REM_UNIT}rem; ${prop}-right: ${v * REM_UNIT}rem;`,
|
|
681
|
-
]),
|
|
682
|
-
...UNITS_ALL.map((v) => [
|
|
683
|
-
`${klass}y-${v}`,
|
|
684
|
-
`${prop}-top: ${v * REM_UNIT}rem; ${prop}-bottom: ${v * REM_UNIT}rem;`,
|
|
685
|
-
]),
|
|
686
|
-
...UNITS_ALL.map((v) => [`${klass}x-${v}px`, `${prop}-left: ${v}px; ${prop}-right: ${v}px;`]),
|
|
687
|
-
...UNITS_ALL.map((v) => [`${klass}y-${v}px`, `${prop}-top: ${v}px; ${prop}-bottom: ${v}px;`]),
|
|
688
|
-
...PERCENTS.map((v) => [`${klass}x-${v}\\%`, `${prop}-left: ${v}%; ${prop}-right: ${v}%;`]),
|
|
689
|
-
...PERCENTS.map((v) => [`${klass}y-${v}\\%`, `${prop}-top: ${v}%; ${prop}-bottom: ${v}%;`]),
|
|
460
|
+
...scaled("", (s) => `${klass}x-${s}`, (v) => `${prop}-left: ${v}; ${prop}-right: ${v};`),
|
|
461
|
+
...scaled("", (s) => `${klass}y-${s}`, (v) => `${prop}-top: ${v}; ${prop}-bottom: ${v};`),
|
|
690
462
|
]));
|
|
691
463
|
}
|
|
692
|
-
function tblr(props) {
|
|
464
|
+
function tblr(props, signs = SIGNS_ANY) {
|
|
693
465
|
return wrap(Object.entries(props).flatMap(([prop, klass]) => [
|
|
694
466
|
[`${klass}t-0`, `${prop}-top: 0`],
|
|
695
467
|
[`${klass}b-0`, `${prop}-bottom: 0`],
|
|
696
468
|
[`${klass}l-0`, `${prop}-left: 0`],
|
|
697
469
|
[`${klass}r-0`, `${prop}-right: 0`],
|
|
698
|
-
[`${klass}
|
|
699
|
-
[`${klass}b-auto`, `${prop}-bottom: auto`],
|
|
700
|
-
[`${klass}l-auto`, `${prop}-left: auto`],
|
|
701
|
-
[`${klass}r-auto`, `${prop}-right: auto`],
|
|
702
|
-
...["", "-"].flatMap((sign) => [
|
|
703
|
-
...UNITS_ALL.map((v) => [
|
|
704
|
-
`${sign}${klass}t-${v}`,
|
|
705
|
-
`${prop}-top: ${sign}${v * REM_UNIT}rem`,
|
|
706
|
-
]),
|
|
707
|
-
...UNITS_ALL.map((v) => [
|
|
708
|
-
`${sign}${klass}b-${v}`,
|
|
709
|
-
`${prop}-bottom: ${sign}${v * REM_UNIT}rem`,
|
|
710
|
-
]),
|
|
711
|
-
...UNITS_ALL.map((v) => [
|
|
712
|
-
`${sign}${klass}l-${v}`,
|
|
713
|
-
`${prop}-left: ${sign}${v * REM_UNIT}rem`,
|
|
714
|
-
]),
|
|
715
|
-
...UNITS_ALL.map((v) => [
|
|
716
|
-
`${sign}${klass}r-${v}`,
|
|
717
|
-
`${prop}-right: ${sign}${v * REM_UNIT}rem`,
|
|
718
|
-
]),
|
|
719
|
-
...UNITS_ALL.map((v) => [`${sign}${klass}t-${v}px`, `${prop}-top: ${sign}${v}px`]),
|
|
720
|
-
...UNITS_ALL.map((v) => [`${sign}${klass}b-${v}px`, `${prop}-bottom: ${sign}${v}px`]),
|
|
721
|
-
...UNITS_ALL.map((v) => [`${sign}${klass}l-${v}px`, `${prop}-left: ${sign}${v}px`]),
|
|
722
|
-
...UNITS_ALL.map((v) => [`${sign}${klass}r-${v}px`, `${prop}-right: ${sign}${v}px`]),
|
|
723
|
-
...PERCENTS.map((v) => [`${sign}${klass}t-${v}\\%`, `${prop}-top: ${sign}${v}%`]),
|
|
724
|
-
...PERCENTS.map((v) => [`${sign}${klass}b-${v}\\%`, `${prop}-bottom: ${sign}${v}%`]),
|
|
725
|
-
...PERCENTS.map((v) => [`${sign}${klass}l-${v}\\%`, `${prop}-left: ${sign}${v}%`]),
|
|
726
|
-
...PERCENTS.map((v) => [`${sign}${klass}r-${v}\\%`, `${prop}-right: ${sign}${v}%`]),
|
|
727
|
-
]),
|
|
470
|
+
...signs.flatMap((sign) => SIDES.flatMap(([side, letter]) => scaled(sign, (s) => `${klass}${letter}-${s}`, (v) => `${prop}-${side}: ${v}`))),
|
|
728
471
|
]));
|
|
729
472
|
}
|
|
730
473
|
function border() {
|
|
@@ -735,12 +478,9 @@ function border() {
|
|
|
735
478
|
...[0, ...UNITS_SM].map((v) => [`border-${v}`, `border-width: ${v}px`]),
|
|
736
479
|
...[0, ...UNITS_SM].map((v) => [`border-x-${v}`, `border-inline-width: ${v}px;`]),
|
|
737
480
|
...[0, ...UNITS_SM].map((v) => [`border-y-${v}`, `border-block-width: ${v}px;`]),
|
|
738
|
-
...[
|
|
739
|
-
[`border-${
|
|
740
|
-
...[0, ...UNITS_SM].map((v) => [
|
|
741
|
-
`border-${dir.slice(0, 1)}-${v}`,
|
|
742
|
-
`border-${dir}-width: ${v}px`,
|
|
743
|
-
]),
|
|
481
|
+
...SIDES.flatMap(([side, letter]) => [
|
|
482
|
+
[`border-${letter}`, `border-${side}-width: 1px`],
|
|
483
|
+
...[0, ...UNITS_SM].map((v) => [`border-${letter}-${v}`, `border-${side}-width: ${v}px`]),
|
|
744
484
|
]),
|
|
745
485
|
]);
|
|
746
486
|
}
|
|
@@ -793,8 +533,10 @@ function between() {
|
|
|
793
533
|
function textSizes() {
|
|
794
534
|
return wrap([
|
|
795
535
|
...Array.from({ length: 100 }, (_, i) => [`text-${i}px`, `font-size: ${i}px`]),
|
|
536
|
+
// Sizes are fractional, and a bare "." in a selector starts a new compound
|
|
537
|
+
// selector, so escape it here. Markup keeps class="text-1.25rem" unescaped.
|
|
796
538
|
...Array.from({ length: 100 }, (_, i) => [
|
|
797
|
-
`text-${i * REM_UNIT}rem`,
|
|
539
|
+
`text-${String(i * REM_UNIT).replace(".", "\\.")}rem`,
|
|
798
540
|
`font-size: ${i * REM_UNIT}rem`,
|
|
799
541
|
]),
|
|
800
542
|
]);
|
|
@@ -830,12 +572,7 @@ function gridPatterns() {
|
|
|
830
572
|
}));
|
|
831
573
|
}
|
|
832
574
|
function custom() {
|
|
833
|
-
return Object.entries(PROPS_CUSTOM).map(([klass,
|
|
834
|
-
const rules = Object.entries(props)
|
|
835
|
-
.map(([k, v]) => `${k}: ${v}`)
|
|
836
|
-
.join("; ");
|
|
837
|
-
return `.${klass} { ${rules} }`;
|
|
838
|
-
});
|
|
575
|
+
return Object.entries(PROPS_CUSTOM).map(([klass, decls]) => `.${klass} { ${decls} }`);
|
|
839
576
|
}
|
|
840
577
|
export function hexToRgb(hex) {
|
|
841
578
|
let r = 0, g = 0, b = 0;
|
|
@@ -895,17 +632,21 @@ export default function rules() {
|
|
|
895
632
|
...transitions(),
|
|
896
633
|
// Position.
|
|
897
634
|
...posneg(PROPS_POSITION),
|
|
898
|
-
// Sizing.
|
|
899
|
-
...posneg(PROPS_SIZING),
|
|
900
|
-
...
|
|
635
|
+
// Sizing. Width and height take neither negatives nor an axis split.
|
|
636
|
+
...posneg(PROPS_SIZING, SIGNS_POSITIVE),
|
|
637
|
+
...autoShorthand(PROPS_SIZING),
|
|
901
638
|
// Spacing. Order matters: shorthand (p-*) -> axis (px-*) -> sides (pt-*),
|
|
902
639
|
// so the more targeted rule wins the cascade at equal specificity.
|
|
903
|
-
...posneg(
|
|
904
|
-
...
|
|
905
|
-
...
|
|
640
|
+
...posneg(PROPS_MARGIN),
|
|
641
|
+
...posneg(PROPS_PADDING, SIGNS_POSITIVE),
|
|
642
|
+
...autoShorthand(PROPS_MARGIN),
|
|
643
|
+
...autoSides(PROPS_MARGIN),
|
|
644
|
+
...axis(PROPS_SPACING),
|
|
645
|
+
...tblr(PROPS_MARGIN),
|
|
646
|
+
...tblr(PROPS_PADDING, SIGNS_POSITIVE),
|
|
906
647
|
...between(),
|
|
907
648
|
// Minmax.
|
|
908
|
-
...posneg(PROPS_SIZING_MINMAX),
|
|
649
|
+
...posneg(PROPS_SIZING_MINMAX, SIGNS_POSITIVE),
|
|
909
650
|
// Border.
|
|
910
651
|
...border(),
|
|
911
652
|
// Text sizes.
|