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/docs/05_css.md
CHANGED
|
@@ -14,24 +14,47 @@ The minimal CSS rules provide a clean, readable default style for standard HTML
|
|
|
14
14
|
- **H1-H6 Margin**: 1em 0 0.5em
|
|
15
15
|
- **P, UL, OL Margin Bottom**: 1em
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## CSS Reset
|
|
18
18
|
|
|
19
|
-
The
|
|
19
|
+
The reset provides a comprehensive set of defaults, widely based on Tailwind CSS Preflight. It ships with the utility classes: adding `css="utils"` to your script tag, or calling `injectCss(["utils"])`, injects both.
|
|
20
20
|
|
|
21
21
|
### Key Features
|
|
22
|
-
- **Box Sizing**: `border-box` globally
|
|
23
22
|
- **Typography**: Default sans-serif font stack, consistent line-height
|
|
24
|
-
- **Form Elements**: Inherit font styles, transparent
|
|
25
|
-
- **Media**: Images/videos max-width 100%
|
|
23
|
+
- **Form Elements**: Inherit font styles and color from their container, with margin and padding zeroed; buttons also get a transparent background and `cursor: pointer`
|
|
26
24
|
- **Dialog**: Default backdrop styling
|
|
27
25
|
- **Resets**: Removes default margins/paddings from most block elements
|
|
28
26
|
|
|
27
|
+
### Layout Effects
|
|
28
|
+
|
|
29
|
+
The reset applies to **all of your markup**, not only to elements carrying utility classes, so plain HTML lays out differently once it is injected. The rules with layout, rather than merely typographic, consequences are:
|
|
30
|
+
|
|
31
|
+
- `img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}` — media is no longer inline. `text-align:center` on a parent stops centering it, the inline baseline gap below images disappears, and images no longer flow alongside adjacent text.
|
|
32
|
+
- `img,video{max-width:100%;height:auto}` — media never overflows its container. `height:auto` also overrides the HTML `height` attribute, so `<img width="300" height="100">` renders at the file's own aspect ratio instead of the requested one. Inside a flex row the same clamp lets an image shrink below its intrinsic size.
|
|
33
|
+
- `*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}` — padding and border no longer add to an element's width. Default borders are also stripped, including those set through presentational HTML attributes, so `fieldset`, `iframe`, `img`, and `table` render without one until a border utility is applied. `hr` is the exception: the reset gives it back a 1px top border so horizontal rules stay visible.
|
|
34
|
+
- `body{margin:0;…}` and `blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}` — the page loses its default gutter and headings, paragraphs, and other blocks no longer space themselves apart, so plain prose collapses into a single run of text until spacing utilities are applied.
|
|
35
|
+
- `ol,ul,menu{list-style:none;margin:0;padding:0}` — bullets, numbers, and list indentation are gone; restore them with the `list-*` and padding utilities.
|
|
36
|
+
- `button,input,optgroup,select,textarea{…;margin:0;padding:0}` — form controls lose their native margin and padding on top of inheriting the surrounding font and color, so inputs and text areas render flush against their content and need padding utilities to look clickable.
|
|
37
|
+
- `button,[type='button'],[type='reset'],[type='submit']{-webkit-appearance:button;background-color:transparent;background-image:none;cursor:pointer}` — buttons lose their native chrome entirely and must be styled explicitly.
|
|
38
|
+
- `:disabled{cursor:default;pointer-events:none;opacity:0.75}` — beyond dimming, `pointer-events:none` is a behavioral change: disabled controls stop receiving hover, tooltip, and click handling. Tailwind Preflight only sets `cursor:default` here; the `pointer-events` and `opacity` declarations are mancha additions.
|
|
39
|
+
|
|
40
|
+
Opt out per element with utilities, e.g. to stop a flex item from being shrunk by its siblings. The class belongs on the flex item itself — on a nested image it does nothing, because only direct children of the flex container are flex items:
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<div class="flex">
|
|
44
|
+
<div class="flex-none">
|
|
45
|
+
<img src="logo.svg" />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The wrapper then keeps its content width, so the image is not shrunk. `flex-none` on the image itself is not enough even when the image is the direct flex child, because `max-width:100%` clamps it regardless of how flex sizes it. That clamp applies everywhere, not just in flex rows: an image in a container narrower than itself is scaled down to fit. Undo it with the arbitrary value `max-w-[none]` — there is no `max-w-none` utility.
|
|
51
|
+
|
|
29
52
|
## Utility CSS
|
|
30
53
|
|
|
31
54
|
The utility CSS rules are inspired by Tailwind CSS. You can inject them using `injectCss(["utils"])` or by adding `css="utils"` to your script tag.
|
|
32
55
|
|
|
33
56
|
This automatically includes:
|
|
34
|
-
- **CSS Reset
|
|
57
|
+
- **CSS Reset**: box-sizing, typography, form and media defaults applied to all of your markup — see [CSS Reset](#css-reset), in particular the layout effects on images, lists, and form controls
|
|
35
58
|
- **Base utility classes**: spacing, sizing, colors, layout, typography, and more
|
|
36
59
|
- **On-demand scanning**: responsive variants, orientation variants, pseudo-state variants, color opacity, custom bracket values, and dark mode are generated on-the-fly for only the classes actually used in your markup
|
|
37
60
|
|
|
@@ -156,19 +179,19 @@ You can also control the opacity of any color utility by appending `/{opacity}`
|
|
|
156
179
|
|
|
157
180
|
| Utility | Description |
|
|
158
181
|
| --- | --- |
|
|
159
|
-
| `border` | `
|
|
160
|
-
| `border-none` | `
|
|
161
|
-
| `border-solid` | `
|
|
162
|
-
| `border-dashed` | `
|
|
163
|
-
| `border-dotted` | `
|
|
164
|
-
| `border-collapse` | `
|
|
165
|
-
| `rounded-none` | `
|
|
166
|
-
| `rounded` | `
|
|
167
|
-
| `rounded-sm` | `
|
|
168
|
-
| `rounded-md` | `
|
|
169
|
-
| `rounded-lg` | `
|
|
170
|
-
| `rounded-xl` | `
|
|
171
|
-
| `rounded-full` | `
|
|
182
|
+
| `border` | `border: 1px solid` |
|
|
183
|
+
| `border-none` | `border: none` |
|
|
184
|
+
| `border-solid` | `border-style: solid` |
|
|
185
|
+
| `border-dashed` | `border-style: dashed` |
|
|
186
|
+
| `border-dotted` | `border-style: dotted` |
|
|
187
|
+
| `border-collapse` | `border-collapse: collapse` |
|
|
188
|
+
| `rounded-none` | `border-radius: 0` |
|
|
189
|
+
| `rounded` | `border-radius: .25rem` |
|
|
190
|
+
| `rounded-sm` | `border-radius: .125rem` |
|
|
191
|
+
| `rounded-md` | `border-radius: .375rem` |
|
|
192
|
+
| `rounded-lg` | `border-radius: .5rem` |
|
|
193
|
+
| `rounded-xl` | `border-radius: .75rem` |
|
|
194
|
+
| `rounded-full` | `border-radius: 9999px` |
|
|
172
195
|
| `border-{0-15}` | Border width in pixels (e.g., `border-0`, `border-1`, ..., `border-15`) |
|
|
173
196
|
| `border-x-{0-15}` | Horizontal border width in pixels |
|
|
174
197
|
| `border-y-{0-15}` | Vertical border width in pixels |
|
|
@@ -178,23 +201,23 @@ You can also control the opacity of any color utility by appending `/{opacity}`
|
|
|
178
201
|
|
|
179
202
|
| Utility | Description |
|
|
180
203
|
| --- | --- |
|
|
181
|
-
| `shadow-2xs` | `
|
|
182
|
-
| `shadow-xs` | `
|
|
183
|
-
| `shadow` | `
|
|
184
|
-
| `shadow-sm` | `
|
|
185
|
-
| `shadow-md` | `
|
|
186
|
-
| `shadow-lg` | `
|
|
187
|
-
| `shadow-xl` | `
|
|
188
|
-
| `shadow-2xl` | `
|
|
189
|
-
| `shadow-inner` | `
|
|
190
|
-
| `shadow-none` | `
|
|
191
|
-
| `ring` | `
|
|
192
|
-
| `ring-0` | `
|
|
193
|
-
| `ring-1` | `
|
|
194
|
-
| `ring-2` | `
|
|
195
|
-
| `ring-4` | `
|
|
196
|
-
| `ring-8` | `
|
|
197
|
-
| `ring-inset` |
|
|
204
|
+
| `shadow-2xs` | `box-shadow: 0 1px rgb(0 0 0 / 0.05)` |
|
|
205
|
+
| `shadow-xs` | `box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05)` |
|
|
206
|
+
| `shadow` | `box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)` |
|
|
207
|
+
| `shadow-sm` | `box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)` |
|
|
208
|
+
| `shadow-md` | `box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)` |
|
|
209
|
+
| `shadow-lg` | `box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)` |
|
|
210
|
+
| `shadow-xl` | `box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)` |
|
|
211
|
+
| `shadow-2xl` | `box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25)` |
|
|
212
|
+
| `shadow-inner` | `box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05)` |
|
|
213
|
+
| `shadow-none` | `box-shadow: 0 0 #0000` |
|
|
214
|
+
| `ring` | `box-shadow: var(--ring-inset, ) 0 0 0 3px rgb(59 130 246 / 0.5)` |
|
|
215
|
+
| `ring-0` | `box-shadow: var(--ring-inset, ) 0 0 0 0px rgb(59 130 246 / 0.5)` |
|
|
216
|
+
| `ring-1` | `box-shadow: var(--ring-inset, ) 0 0 0 1px rgb(59 130 246 / 0.5)` |
|
|
217
|
+
| `ring-2` | `box-shadow: var(--ring-inset, ) 0 0 0 2px rgb(59 130 246 / 0.5)` |
|
|
218
|
+
| `ring-4` | `box-shadow: var(--ring-inset, ) 0 0 0 4px rgb(59 130 246 / 0.5)` |
|
|
219
|
+
| `ring-8` | `box-shadow: var(--ring-inset, ) 0 0 0 8px rgb(59 130 246 / 0.5)` |
|
|
220
|
+
| `ring-inset` | `--ring-inset: inset` |
|
|
198
221
|
| `opacity-0` | Fully transparent |
|
|
199
222
|
| `opacity-{5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100}` | Opacity values (multiples of 5) |
|
|
200
223
|
|
|
@@ -202,191 +225,191 @@ You can also control the opacity of any color utility by appending `/{opacity}`
|
|
|
202
225
|
|
|
203
226
|
| Utility | Description |
|
|
204
227
|
| --- | --- |
|
|
205
|
-
| `outline` | `
|
|
206
|
-
| `outline-none` | `
|
|
207
|
-
| `outline-dashed` | `
|
|
208
|
-
| `outline-dotted` | `
|
|
209
|
-
| `outline-double` | `
|
|
210
|
-
| `outline-0` | `
|
|
211
|
-
| `outline-1` | `
|
|
212
|
-
| `outline-2` | `
|
|
213
|
-
| `outline-4` | `
|
|
214
|
-
| `outline-8` | `
|
|
215
|
-
| `outline-offset-0` | `
|
|
216
|
-
| `outline-offset-1` | `
|
|
217
|
-
| `outline-offset-2` | `
|
|
218
|
-
| `outline-offset-4` | `
|
|
219
|
-
| `outline-offset-8` | `
|
|
228
|
+
| `outline` | `outline-style: solid` |
|
|
229
|
+
| `outline-none` | `outline: 2px solid transparent; outline-offset: 2px` |
|
|
230
|
+
| `outline-dashed` | `outline-style: dashed` |
|
|
231
|
+
| `outline-dotted` | `outline-style: dotted` |
|
|
232
|
+
| `outline-double` | `outline-style: double` |
|
|
233
|
+
| `outline-0` | `outline-width: 0px` |
|
|
234
|
+
| `outline-1` | `outline-width: 1px` |
|
|
235
|
+
| `outline-2` | `outline-width: 2px` |
|
|
236
|
+
| `outline-4` | `outline-width: 4px` |
|
|
237
|
+
| `outline-8` | `outline-width: 8px` |
|
|
238
|
+
| `outline-offset-0` | `outline-offset: 0px` |
|
|
239
|
+
| `outline-offset-1` | `outline-offset: 1px` |
|
|
240
|
+
| `outline-offset-2` | `outline-offset: 2px` |
|
|
241
|
+
| `outline-offset-4` | `outline-offset: 4px` |
|
|
242
|
+
| `outline-offset-8` | `outline-offset: 8px` |
|
|
220
243
|
|
|
221
244
|
### Aspect Ratio
|
|
222
245
|
|
|
223
246
|
| Utility | Description |
|
|
224
247
|
| --- | --- |
|
|
225
|
-
| `aspect-auto` | `
|
|
226
|
-
| `aspect-square` | `
|
|
227
|
-
| `aspect-video` | `
|
|
248
|
+
| `aspect-auto` | `aspect-ratio: auto` |
|
|
249
|
+
| `aspect-square` | `aspect-ratio: 1 / 1` |
|
|
250
|
+
| `aspect-video` | `aspect-ratio: 16 / 9` |
|
|
228
251
|
|
|
229
252
|
### Backdrop Filters
|
|
230
253
|
|
|
231
254
|
| Utility | Description |
|
|
232
255
|
| --- | --- |
|
|
233
|
-
| `backdrop-blur-none` | `
|
|
234
|
-
| `backdrop-blur-sm` | `
|
|
235
|
-
| `backdrop-blur` | `
|
|
236
|
-
| `backdrop-blur-md` | `
|
|
237
|
-
| `backdrop-blur-lg` | `
|
|
238
|
-
| `backdrop-blur-xl` | `
|
|
239
|
-
| `backdrop-blur-2xl` | `
|
|
240
|
-
| `backdrop-blur-3xl` | `
|
|
256
|
+
| `backdrop-blur-none` | `backdrop-filter: blur(0)` |
|
|
257
|
+
| `backdrop-blur-sm` | `backdrop-filter: blur(4px)` |
|
|
258
|
+
| `backdrop-blur` | `backdrop-filter: blur(8px)` |
|
|
259
|
+
| `backdrop-blur-md` | `backdrop-filter: blur(12px)` |
|
|
260
|
+
| `backdrop-blur-lg` | `backdrop-filter: blur(16px)` |
|
|
261
|
+
| `backdrop-blur-xl` | `backdrop-filter: blur(24px)` |
|
|
262
|
+
| `backdrop-blur-2xl` | `backdrop-filter: blur(40px)` |
|
|
263
|
+
| `backdrop-blur-3xl` | `backdrop-filter: blur(64px)` |
|
|
241
264
|
|
|
242
265
|
### Transitions & Animations
|
|
243
266
|
|
|
244
267
|
| Utility | Description |
|
|
245
268
|
| --- | --- |
|
|
246
|
-
| `transition-none` | `
|
|
247
|
-
| `transition` | `
|
|
248
|
-
| `transition-all` | `
|
|
249
|
-
| `transition-opacity` | `
|
|
250
|
-
| `transition-transform` | `
|
|
251
|
-
| `transition-shadow` | `
|
|
252
|
-
| `transition-colors` | `
|
|
253
|
-
| `animate-none` | `
|
|
254
|
-
| `animate-spin` | `
|
|
255
|
-
| `animate-ping` | `
|
|
256
|
-
| `animate-pulse` | `
|
|
269
|
+
| `transition-none` | `transition: none` |
|
|
270
|
+
| `transition` | `transition-property: all; transition-timing-function: ease-in-out; transition-duration: var(--transition-duration, 150ms)` |
|
|
271
|
+
| `transition-all` | `transition-property: all; transition-timing-function: ease-in-out; transition-duration: var(--transition-duration, 150ms)` |
|
|
272
|
+
| `transition-opacity` | `transition-property: opacity; transition-timing-function: ease-in-out; transition-duration: var(--transition-duration, 150ms)` |
|
|
273
|
+
| `transition-transform` | `transition-property: transform; transition-timing-function: ease-in-out; transition-duration: var(--transition-duration, 150ms)` |
|
|
274
|
+
| `transition-shadow` | `transition-property: box-shadow; transition-timing-function: ease-in-out; transition-duration: var(--transition-duration, 150ms)` |
|
|
275
|
+
| `transition-colors` | `transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: ease-in-out; transition-duration: var(--transition-duration, 150ms)` |
|
|
276
|
+
| `animate-none` | `animation: none` |
|
|
277
|
+
| `animate-spin` | `animation: spin 1s linear infinite` |
|
|
278
|
+
| `animate-ping` | `animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite` |
|
|
279
|
+
| `animate-pulse` | `animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite` |
|
|
257
280
|
| `duration-{25,50,75,100,150,200,300,500,700,1000}` | Transition duration in milliseconds |
|
|
258
281
|
|
|
259
282
|
### Interactivity
|
|
260
283
|
|
|
261
284
|
| Utility | Description |
|
|
262
285
|
| --- | --- |
|
|
263
|
-
| `cursor-pointer` | `
|
|
264
|
-
| `cursor-wait` | `
|
|
265
|
-
| `cursor-not-allowed` | `
|
|
266
|
-
| `select-none` | `
|
|
267
|
-
| `select-all` | `
|
|
268
|
-
| `pointer-events-auto` | `
|
|
269
|
-
| `pointer-events-none` | `
|
|
270
|
-
| `resize` | `
|
|
271
|
-
| `resize-x` | `
|
|
272
|
-
| `resize-y` | `
|
|
273
|
-
| `resize-none` | `
|
|
286
|
+
| `cursor-pointer` | `cursor: pointer` |
|
|
287
|
+
| `cursor-wait` | `cursor: wait` |
|
|
288
|
+
| `cursor-not-allowed` | `cursor: not-allowed` |
|
|
289
|
+
| `select-none` | `user-select: none` |
|
|
290
|
+
| `select-all` | `user-select: all` |
|
|
291
|
+
| `pointer-events-auto` | `pointer-events: auto` |
|
|
292
|
+
| `pointer-events-none` | `pointer-events: none` |
|
|
293
|
+
| `resize` | `resize: both` |
|
|
294
|
+
| `resize-x` | `resize: horizontal` |
|
|
295
|
+
| `resize-y` | `resize: vertical` |
|
|
296
|
+
| `resize-none` | `resize: none` |
|
|
274
297
|
|
|
275
298
|
### Typography
|
|
276
299
|
|
|
277
300
|
| Utility | Description |
|
|
278
301
|
| --- | --- |
|
|
279
|
-
| `font-mono` | `
|
|
280
|
-
| `font-sans` | `
|
|
281
|
-
| `font-serif` | `
|
|
282
|
-
| `font-cursive` | `
|
|
283
|
-
| `text-xs` | `
|
|
284
|
-
| `text-sm` | `
|
|
285
|
-
| `text-base` | `
|
|
286
|
-
| `text-lg` | `
|
|
287
|
-
| `text-xl` | `
|
|
288
|
-
| `text-2xl` | `
|
|
289
|
-
| `text-3xl` | `
|
|
290
|
-
| `text-4xl` | `
|
|
291
|
-
| `text-5xl` | `
|
|
292
|
-
| `text-6xl` | `
|
|
293
|
-
| `text-7xl` | `
|
|
294
|
-
| `font-thin` | `
|
|
295
|
-
| `font-extralight` | `
|
|
296
|
-
| `font-light` | `
|
|
297
|
-
| `font-normal` | `
|
|
298
|
-
| `font-medium` | `
|
|
299
|
-
| `font-semibold` | `
|
|
300
|
-
| `font-bold` | `
|
|
301
|
-
| `font-extrabold` | `
|
|
302
|
-
| `font-black` | `
|
|
303
|
-
| `italic` | `
|
|
304
|
-
| `not-italic` | `
|
|
305
|
-
| `tracking-tighter` | `
|
|
306
|
-
| `tracking-tight` | `
|
|
307
|
-
| `tracking-normal` | `
|
|
308
|
-
| `tracking-wide` | `
|
|
309
|
-
| `tracking-wider` | `
|
|
310
|
-
| `tracking-widest` | `
|
|
311
|
-
| `leading-none` | `
|
|
312
|
-
| `leading-tight` | `
|
|
313
|
-
| `leading-snug` | `
|
|
314
|
-
| `leading-normal` | `
|
|
315
|
-
| `leading-relaxed` | `
|
|
316
|
-
| `leading-loose` | `
|
|
317
|
-
| `text-left` | `
|
|
318
|
-
| `text-right` | `
|
|
319
|
-
| `text-center` | `
|
|
320
|
-
| `text-justify` | `
|
|
321
|
-
| `underline` | `
|
|
322
|
-
| `decoration-none` | `
|
|
323
|
-
| `line-through` | `
|
|
324
|
-
| `uppercase` | `
|
|
325
|
-
| `lowercase` | `
|
|
326
|
-
| `capitalize` | `
|
|
327
|
-
| `truncate` | `
|
|
328
|
-
| `text-elipsis` | `
|
|
329
|
-
| `text-clip` | `
|
|
330
|
-
| `text-wrap` | `
|
|
331
|
-
| `text-nowrap` | `
|
|
332
|
-
| `text-balance` | `
|
|
333
|
-
| `text-pretty` | `
|
|
334
|
-
| `whitespace-normal` | `
|
|
335
|
-
| `whitespace-nowrap` | `
|
|
336
|
-
| `whitespace-pre` | `
|
|
337
|
-
| `whitespace-pre-line` | `
|
|
338
|
-
| `whitespace-pre-wrap` | `
|
|
339
|
-
| `whitespace-break-spaces` | `
|
|
302
|
+
| `font-mono` | `font-family: monospace` |
|
|
303
|
+
| `font-sans` | `font-family: sans-serif` |
|
|
304
|
+
| `font-serif` | `font-family: serif` |
|
|
305
|
+
| `font-cursive` | `font-family: cursive` |
|
|
306
|
+
| `text-xs` | `font-size: .75rem; line-height: calc(1 / 0.75)` |
|
|
307
|
+
| `text-sm` | `font-size: .875rem; line-height: calc(1.25 / 0.875)` |
|
|
308
|
+
| `text-base` | `font-size: 1rem; line-height: calc(1.5 / 1)` |
|
|
309
|
+
| `text-lg` | `font-size: 1.125rem; line-height: calc(1.75 / 1.125)` |
|
|
310
|
+
| `text-xl` | `font-size: 1.25rem; line-height: calc(1.75 / 1.25)` |
|
|
311
|
+
| `text-2xl` | `font-size: 1.5rem; line-height: calc(2 / 1.5)` |
|
|
312
|
+
| `text-3xl` | `font-size: 1.875rem; line-height: calc(2.25 / 1.875)` |
|
|
313
|
+
| `text-4xl` | `font-size: 2.25rem; line-height: calc(2.5 / 2.25)` |
|
|
314
|
+
| `text-5xl` | `font-size: 3rem; line-height: 1` |
|
|
315
|
+
| `text-6xl` | `font-size: 3.75rem; line-height: 1` |
|
|
316
|
+
| `text-7xl` | `font-size: 4.5rem; line-height: 1` |
|
|
317
|
+
| `font-thin` | `font-weight: 100` |
|
|
318
|
+
| `font-extralight` | `font-weight: 200` |
|
|
319
|
+
| `font-light` | `font-weight: 300` |
|
|
320
|
+
| `font-normal` | `font-weight: 400` |
|
|
321
|
+
| `font-medium` | `font-weight: 500` |
|
|
322
|
+
| `font-semibold` | `font-weight: 600` |
|
|
323
|
+
| `font-bold` | `font-weight: 700` |
|
|
324
|
+
| `font-extrabold` | `font-weight: 800` |
|
|
325
|
+
| `font-black` | `font-weight: 900` |
|
|
326
|
+
| `italic` | `font-style: italic` |
|
|
327
|
+
| `not-italic` | `font-style: normal` |
|
|
328
|
+
| `tracking-tighter` | `letter-spacing: -0.05em` |
|
|
329
|
+
| `tracking-tight` | `letter-spacing: -0.025em` |
|
|
330
|
+
| `tracking-normal` | `letter-spacing: 0` |
|
|
331
|
+
| `tracking-wide` | `letter-spacing: 0.025em` |
|
|
332
|
+
| `tracking-wider` | `letter-spacing: 0.05em` |
|
|
333
|
+
| `tracking-widest` | `letter-spacing: 0.1em` |
|
|
334
|
+
| `leading-none` | `line-height: 1` |
|
|
335
|
+
| `leading-tight` | `line-height: 1.25` |
|
|
336
|
+
| `leading-snug` | `line-height: 1.375` |
|
|
337
|
+
| `leading-normal` | `line-height: 1.5` |
|
|
338
|
+
| `leading-relaxed` | `line-height: 1.625` |
|
|
339
|
+
| `leading-loose` | `line-height: 2` |
|
|
340
|
+
| `text-left` | `text-align: left` |
|
|
341
|
+
| `text-right` | `text-align: right` |
|
|
342
|
+
| `text-center` | `text-align: center` |
|
|
343
|
+
| `text-justify` | `text-align: justify` |
|
|
344
|
+
| `underline` | `text-decoration: underline` |
|
|
345
|
+
| `decoration-none` | `text-decoration: none` |
|
|
346
|
+
| `line-through` | `text-decoration: line-through` |
|
|
347
|
+
| `uppercase` | `text-transform: uppercase` |
|
|
348
|
+
| `lowercase` | `text-transform: lowercase` |
|
|
349
|
+
| `capitalize` | `text-transform: capitalize` |
|
|
350
|
+
| `truncate` | `white-space: nowrap; overflow: hidden; text-overflow: ellipsis` |
|
|
351
|
+
| `text-elipsis` | `text-overflow: ellipsis` |
|
|
352
|
+
| `text-clip` | `text-overflow: clip` |
|
|
353
|
+
| `text-wrap` | `text-wrap: wrap` |
|
|
354
|
+
| `text-nowrap` | `text-wrap: nowrap` |
|
|
355
|
+
| `text-balance` | `text-wrap: balance` |
|
|
356
|
+
| `text-pretty` | `text-wrap: pretty` |
|
|
357
|
+
| `whitespace-normal` | `white-space: normal` |
|
|
358
|
+
| `whitespace-nowrap` | `white-space: nowrap` |
|
|
359
|
+
| `whitespace-pre` | `white-space: pre` |
|
|
360
|
+
| `whitespace-pre-line` | `white-space: pre-line` |
|
|
361
|
+
| `whitespace-pre-wrap` | `white-space: pre-wrap` |
|
|
362
|
+
| `whitespace-break-spaces` | `white-space: break-spaces` |
|
|
340
363
|
|
|
341
364
|
### Flexbox & Layout
|
|
342
365
|
|
|
343
366
|
| Utility | Description |
|
|
344
367
|
| --- | --- |
|
|
345
|
-
| `flex` | `
|
|
346
|
-
| `flex-1` | `
|
|
347
|
-
| `flex-inline` | `
|
|
348
|
-
| `flex-row` | `
|
|
349
|
-
| `flex-col` | `
|
|
350
|
-
| `flex-row-reverse` | `
|
|
351
|
-
| `flex-col-reverse` | `
|
|
352
|
-
| `flex-wrap` | `
|
|
353
|
-
| `flex-wrap-reverse` | `
|
|
354
|
-
| `flex-nowrap` | `
|
|
355
|
-
| `justify-start` | `
|
|
356
|
-
| `justify-end` | `
|
|
357
|
-
| `justify-center` | `
|
|
358
|
-
| `justify-between` | `
|
|
359
|
-
| `justify-around` | `
|
|
360
|
-
| `justify-evenly` | `
|
|
361
|
-
| `justify-stretch` | `
|
|
362
|
-
| `items-start` | `
|
|
363
|
-
| `items-end` | `
|
|
364
|
-
| `items-center` | `
|
|
365
|
-
| `items-stretch` | `
|
|
366
|
-
| `flex-grow` | `
|
|
367
|
-
| `flex-shrink` | `
|
|
368
|
-
| `flex-none` | `
|
|
369
|
-
| `flex-auto` | `
|
|
370
|
-
| `flex-initial` | `
|
|
371
|
-
| `grow` | `
|
|
372
|
-
| `grow-0` | `
|
|
373
|
-
| `shrink` | `
|
|
374
|
-
| `shrink-0` | `
|
|
375
|
-
| `self-auto` | `
|
|
376
|
-
| `self-start` | `
|
|
377
|
-
| `self-end` | `
|
|
378
|
-
| `self-center` | `
|
|
379
|
-
| `self-stretch` | `
|
|
380
|
-
| `self-baseline` | `
|
|
381
|
-
| `content-normal` | `
|
|
382
|
-
| `content-start` | `
|
|
383
|
-
| `content-end` | `
|
|
384
|
-
| `content-center` | `
|
|
385
|
-
| `content-between` | `
|
|
386
|
-
| `content-around` | `
|
|
387
|
-
| `content-evenly` | `
|
|
388
|
-
| `content-stretch` | `
|
|
389
|
-
| `items-baseline` | `
|
|
368
|
+
| `flex` | `display: flex` |
|
|
369
|
+
| `flex-1` | `flex: 1 1 0%` |
|
|
370
|
+
| `flex-inline` | `display: inline-flex` |
|
|
371
|
+
| `flex-row` | `flex-direction: row` |
|
|
372
|
+
| `flex-col` | `flex-direction: column` |
|
|
373
|
+
| `flex-row-reverse` | `flex-direction: row-reverse` |
|
|
374
|
+
| `flex-col-reverse` | `flex-direction: column-reverse` |
|
|
375
|
+
| `flex-wrap` | `flex-wrap: wrap` |
|
|
376
|
+
| `flex-wrap-reverse` | `flex-wrap: wrap-reverse` |
|
|
377
|
+
| `flex-nowrap` | `flex-wrap: nowrap` |
|
|
378
|
+
| `justify-start` | `justify-content: flex-start` |
|
|
379
|
+
| `justify-end` | `justify-content: flex-end` |
|
|
380
|
+
| `justify-center` | `justify-content: center` |
|
|
381
|
+
| `justify-between` | `justify-content: space-between` |
|
|
382
|
+
| `justify-around` | `justify-content: space-around` |
|
|
383
|
+
| `justify-evenly` | `justify-content: space-evenly` |
|
|
384
|
+
| `justify-stretch` | `justify-content: stretch` |
|
|
385
|
+
| `items-start` | `align-items: flex-start` |
|
|
386
|
+
| `items-end` | `align-items: flex-end` |
|
|
387
|
+
| `items-center` | `align-items: center` |
|
|
388
|
+
| `items-stretch` | `align-items: stretch` |
|
|
389
|
+
| `flex-grow` | `flex-grow: 1` |
|
|
390
|
+
| `flex-shrink` | `flex-shrink: 1` |
|
|
391
|
+
| `flex-none` | `flex: none` |
|
|
392
|
+
| `flex-auto` | `flex: 1 1 auto` |
|
|
393
|
+
| `flex-initial` | `flex: 0 1 auto` |
|
|
394
|
+
| `grow` | `flex-grow: 1` |
|
|
395
|
+
| `grow-0` | `flex-grow: 0` |
|
|
396
|
+
| `shrink` | `flex-shrink: 1` |
|
|
397
|
+
| `shrink-0` | `flex-shrink: 0` |
|
|
398
|
+
| `self-auto` | `align-self: auto` |
|
|
399
|
+
| `self-start` | `align-self: flex-start` |
|
|
400
|
+
| `self-end` | `align-self: flex-end` |
|
|
401
|
+
| `self-center` | `align-self: center` |
|
|
402
|
+
| `self-stretch` | `align-self: stretch` |
|
|
403
|
+
| `self-baseline` | `align-self: baseline` |
|
|
404
|
+
| `content-normal` | `align-content: normal` |
|
|
405
|
+
| `content-start` | `align-content: flex-start` |
|
|
406
|
+
| `content-end` | `align-content: flex-end` |
|
|
407
|
+
| `content-center` | `align-content: center` |
|
|
408
|
+
| `content-between` | `align-content: space-between` |
|
|
409
|
+
| `content-around` | `align-content: space-around` |
|
|
410
|
+
| `content-evenly` | `align-content: space-evenly` |
|
|
411
|
+
| `content-stretch` | `align-content: stretch` |
|
|
412
|
+
| `items-baseline` | `align-items: baseline` |
|
|
390
413
|
| `gap-0` | No gap |
|
|
391
414
|
| `gap-{1-512}` | Gap in rem units (0.25rem increments) |
|
|
392
415
|
| `gap-{1-512}px` | Gap in pixels |
|
|
@@ -411,7 +434,7 @@ You can also control the opacity of any color utility by appending `/{opacity}`
|
|
|
411
434
|
|
|
412
435
|
| Utility | Description |
|
|
413
436
|
| --- | --- |
|
|
414
|
-
| `grid` | `
|
|
437
|
+
| `grid` | `display: grid` |
|
|
415
438
|
| `grid-cols-{1-12}` | `grid-template-columns: repeat(n, minmax(0, 1fr))` |
|
|
416
439
|
| `grid-cols-none` | `grid-template-columns: none` |
|
|
417
440
|
| `col-span-{1-12}` | `grid-column: span n / span n` |
|
|
@@ -431,20 +454,20 @@ You can also control the opacity of any color utility by appending `/{opacity}`
|
|
|
431
454
|
|
|
432
455
|
| Utility | Description |
|
|
433
456
|
| --- | --- |
|
|
434
|
-
| `relative` | `
|
|
435
|
-
| `fixed` | `
|
|
436
|
-
| `absolute` | `
|
|
437
|
-
| `sticky` | `
|
|
438
|
-
| `object-contain` | `
|
|
439
|
-
| `object-cover` | `
|
|
440
|
-
| `object-fill` | `
|
|
441
|
-
| `object-none` | `
|
|
442
|
-
| `inset-0` | `
|
|
443
|
-
| `inset-auto` | `
|
|
444
|
-
| `inset-x-0` | `
|
|
445
|
-
| `inset-y-0` | `
|
|
446
|
-
| `inset-x-auto` | `
|
|
447
|
-
| `inset-y-auto` | `
|
|
457
|
+
| `relative` | `position: relative` |
|
|
458
|
+
| `fixed` | `position: fixed` |
|
|
459
|
+
| `absolute` | `position: absolute` |
|
|
460
|
+
| `sticky` | `position: sticky` |
|
|
461
|
+
| `object-contain` | `object-fit: contain` |
|
|
462
|
+
| `object-cover` | `object-fit: cover` |
|
|
463
|
+
| `object-fill` | `object-fit: fill` |
|
|
464
|
+
| `object-none` | `object-fit: none` |
|
|
465
|
+
| `inset-0` | `inset: 0` |
|
|
466
|
+
| `inset-auto` | `inset: auto` |
|
|
467
|
+
| `inset-x-0` | `left: 0; right: 0` |
|
|
468
|
+
| `inset-y-0` | `top: 0; bottom: 0` |
|
|
469
|
+
| `inset-x-auto` | `left: auto; right: auto` |
|
|
470
|
+
| `inset-y-auto` | `top: auto; bottom: auto` |
|
|
448
471
|
| `top-{0-512}`, `bottom-{0-512}`, `left-{0-512}`, `right-{0-512}` | Position in rem units (0.25rem increments) |
|
|
449
472
|
| `top-{0-512}px`, `bottom-{0-512}px`, `left-{0-512}px`, `right-{0-512}px` | Position in pixels |
|
|
450
473
|
| `top-{1-100}%`, `bottom-{1-100}%`, `left-{1-100}%`, `right-{1-100}%` | Position in percentages |
|
|
@@ -455,108 +478,108 @@ You can also control the opacity of any color utility by appending `/{opacity}`
|
|
|
455
478
|
|
|
456
479
|
| Utility | Description |
|
|
457
480
|
| --- | --- |
|
|
458
|
-
| `block` | `
|
|
459
|
-
| `contents` | `
|
|
460
|
-
| `hidden` | `
|
|
461
|
-
| `inline` | `
|
|
462
|
-
| `visible` | `
|
|
463
|
-
| `invisible` | `
|
|
464
|
-
| `collapse` | `
|
|
481
|
+
| `block` | `display: block` |
|
|
482
|
+
| `contents` | `display: contents` |
|
|
483
|
+
| `hidden` | `display: none` |
|
|
484
|
+
| `inline` | `display: inline` |
|
|
485
|
+
| `visible` | `visibility: visible` |
|
|
486
|
+
| `invisible` | `visibility: hidden` |
|
|
487
|
+
| `collapse` | `visibility: collapse` |
|
|
465
488
|
|
|
466
489
|
### Overflow & Scrolling
|
|
467
490
|
|
|
468
491
|
| Utility | Description |
|
|
469
492
|
| --- | --- |
|
|
470
|
-
| `overflow-auto` | `
|
|
471
|
-
| `overflow-x-auto` | `
|
|
472
|
-
| `overflow-y-auto` | `
|
|
473
|
-
| `overflow-hidden` | `
|
|
474
|
-
| `overflow-x-hidden` | `
|
|
475
|
-
| `overflow-y-hidden` | `
|
|
476
|
-
| `overflow-visible` | `
|
|
477
|
-
| `overscroll-auto` | `
|
|
478
|
-
| `overscroll-contain` | `
|
|
479
|
-
| `overscroll-none` | `
|
|
480
|
-
| `overscroll-x-auto` | `
|
|
481
|
-
| `overscroll-x-contain` | `
|
|
482
|
-
| `overscroll-x-none` | `
|
|
483
|
-
| `overscroll-y-auto` | `
|
|
484
|
-
| `overscroll-y-contain` | `
|
|
485
|
-
| `overscroll-y-none` | `
|
|
493
|
+
| `overflow-auto` | `overflow: auto` |
|
|
494
|
+
| `overflow-x-auto` | `overflow-x: auto` |
|
|
495
|
+
| `overflow-y-auto` | `overflow-y: auto` |
|
|
496
|
+
| `overflow-hidden` | `overflow: hidden` |
|
|
497
|
+
| `overflow-x-hidden` | `overflow-x: hidden` |
|
|
498
|
+
| `overflow-y-hidden` | `overflow-y: hidden` |
|
|
499
|
+
| `overflow-visible` | `overflow: visible` |
|
|
500
|
+
| `overscroll-auto` | `overscroll-behavior: auto` |
|
|
501
|
+
| `overscroll-contain` | `overscroll-behavior: contain` |
|
|
502
|
+
| `overscroll-none` | `overscroll-behavior: none` |
|
|
503
|
+
| `overscroll-x-auto` | `overscroll-behavior-x: auto` |
|
|
504
|
+
| `overscroll-x-contain` | `overscroll-behavior-x: contain` |
|
|
505
|
+
| `overscroll-x-none` | `overscroll-behavior-x: none` |
|
|
506
|
+
| `overscroll-y-auto` | `overscroll-behavior-y: auto` |
|
|
507
|
+
| `overscroll-y-contain` | `overscroll-behavior-y: contain` |
|
|
508
|
+
| `overscroll-y-none` | `overscroll-behavior-y: none` |
|
|
486
509
|
|
|
487
510
|
### Backgrounds
|
|
488
511
|
|
|
489
512
|
| Utility | Description |
|
|
490
513
|
| --- | --- |
|
|
491
|
-
| `bg-auto` | `
|
|
492
|
-
| `bg-cover` | `
|
|
493
|
-
| `bg-contain` | `
|
|
494
|
-
| `bg-center` | `
|
|
495
|
-
| `bg-top` | `
|
|
496
|
-
| `bg-bottom` | `
|
|
497
|
-
| `bg-left` | `
|
|
498
|
-
| `bg-right` | `
|
|
499
|
-
| `bg-left-top` | `
|
|
500
|
-
| `bg-left-bottom` | `
|
|
501
|
-
| `bg-right-top` | `
|
|
502
|
-
| `bg-right-bottom` | `
|
|
503
|
-
| `bg-no-repeat` | `
|
|
504
|
-
| `bg-fixed` | `
|
|
505
|
-
| `bg-local` | `
|
|
506
|
-
| `bg-scroll` | `
|
|
514
|
+
| `bg-auto` | `background-size: auto` |
|
|
515
|
+
| `bg-cover` | `background-size: cover` |
|
|
516
|
+
| `bg-contain` | `background-size: contain` |
|
|
517
|
+
| `bg-center` | `background-position: center` |
|
|
518
|
+
| `bg-top` | `background-position: top` |
|
|
519
|
+
| `bg-bottom` | `background-position: bottom` |
|
|
520
|
+
| `bg-left` | `background-position: left` |
|
|
521
|
+
| `bg-right` | `background-position: right` |
|
|
522
|
+
| `bg-left-top` | `background-position: left top` |
|
|
523
|
+
| `bg-left-bottom` | `background-position: left bottom` |
|
|
524
|
+
| `bg-right-top` | `background-position: right top` |
|
|
525
|
+
| `bg-right-bottom` | `background-position: right bottom` |
|
|
526
|
+
| `bg-no-repeat` | `background-repeat: no-repeat` |
|
|
527
|
+
| `bg-fixed` | `background-attachment: fixed` |
|
|
528
|
+
| `bg-local` | `background-attachment: local` |
|
|
529
|
+
| `bg-scroll` | `background-attachment: scroll` |
|
|
507
530
|
|
|
508
531
|
### Lists
|
|
509
532
|
|
|
510
533
|
| Utility | Description |
|
|
511
534
|
| --- | --- |
|
|
512
|
-
| `list-none` | `
|
|
513
|
-
| `list-disc` | `
|
|
514
|
-
| `list-decimal` | `
|
|
535
|
+
| `list-none` | `list-style-type: none` |
|
|
536
|
+
| `list-disc` | `list-style-type: disc` |
|
|
537
|
+
| `list-decimal` | `list-style-type: decimal` |
|
|
515
538
|
|
|
516
539
|
### Vertical Alignment
|
|
517
540
|
|
|
518
541
|
| Utility | Description |
|
|
519
542
|
| --- | --- |
|
|
520
|
-
| `align-baseline` | `
|
|
521
|
-
| `align-top` | `
|
|
522
|
-
| `align-middle` | `
|
|
523
|
-
| `align-bottom` | `
|
|
524
|
-
| `align-text-top` | `
|
|
525
|
-
| `align-text-bottom` | `
|
|
543
|
+
| `align-baseline` | `vertical-align: baseline` |
|
|
544
|
+
| `align-top` | `vertical-align: top` |
|
|
545
|
+
| `align-middle` | `vertical-align: middle` |
|
|
546
|
+
| `align-bottom` | `vertical-align: bottom` |
|
|
547
|
+
| `align-text-top` | `vertical-align: text-top` |
|
|
548
|
+
| `align-text-bottom` | `vertical-align: text-bottom` |
|
|
526
549
|
|
|
527
550
|
### Viewport Sizing
|
|
528
551
|
|
|
529
552
|
| Utility | Description |
|
|
530
553
|
| --- | --- |
|
|
531
|
-
| `min-h-screen` | `
|
|
532
|
-
| `max-h-screen` | `
|
|
533
|
-
| `min-w-screen` | `
|
|
534
|
-
| `h-dvh` | `
|
|
535
|
-
| `h-svh` | `
|
|
536
|
-
| `h-lvh` | `
|
|
537
|
-
| `w-dvw` | `
|
|
538
|
-
| `w-svw` | `
|
|
539
|
-
| `w-lvw` | `
|
|
540
|
-
| `min-h-dvh` | `
|
|
541
|
-
| `min-h-svh` | `
|
|
542
|
-
| `min-h-lvh` | `
|
|
554
|
+
| `min-h-screen` | `min-height: 100vh` |
|
|
555
|
+
| `max-h-screen` | `max-height: 100vh` |
|
|
556
|
+
| `min-w-screen` | `min-width: 100vw` |
|
|
557
|
+
| `h-dvh` | `height: 100dvh` |
|
|
558
|
+
| `h-svh` | `height: 100svh` |
|
|
559
|
+
| `h-lvh` | `height: 100lvh` |
|
|
560
|
+
| `w-dvw` | `width: 100dvw` |
|
|
561
|
+
| `w-svw` | `width: 100svw` |
|
|
562
|
+
| `w-lvw` | `width: 100lvw` |
|
|
563
|
+
| `min-h-dvh` | `min-height: 100dvh` |
|
|
564
|
+
| `min-h-svh` | `min-height: 100svh` |
|
|
565
|
+
| `min-h-lvh` | `min-height: 100lvh` |
|
|
543
566
|
|
|
544
567
|
### Accessibility
|
|
545
568
|
|
|
546
569
|
| Utility | Description |
|
|
547
570
|
| --- | --- |
|
|
548
|
-
| `sr-only` | `
|
|
549
|
-
| `not-sr-only` | `
|
|
571
|
+
| `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` |
|
|
572
|
+
| `not-sr-only` | `position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal` |
|
|
550
573
|
|
|
551
574
|
### Other Utilities
|
|
552
575
|
|
|
553
576
|
| Utility | Description |
|
|
554
577
|
| --- | --- |
|
|
555
|
-
| `no-underline` | `
|
|
556
|
-
| `grid` | `
|
|
557
|
-
| `box-border` | `
|
|
558
|
-
| `box-content` | `
|
|
559
|
-
| `appearance-none` | `
|
|
578
|
+
| `no-underline` | `text-decoration: none` |
|
|
579
|
+
| `grid` | `display: grid` |
|
|
580
|
+
| `box-border` | `box-sizing: border-box` |
|
|
581
|
+
| `box-content` | `box-sizing: content-box` |
|
|
582
|
+
| `appearance-none` | `appearance: none; -webkit-appearance: none; -moz-appearance: none` |
|
|
560
583
|
| `text-{0-99}px` | Font size in pixels (e.g., `text-12px`, `text-16px`) |
|
|
561
584
|
| `text-{0-24.75}rem` | Font size in rem units (0.25rem increments) |
|
|
562
585
|
|
|
@@ -597,18 +620,13 @@ Custom values support pseudo-states, responsive breakpoints, and dark mode:
|
|
|
597
620
|
<div class="hover:w-[200px] md:max-w-[900px] dark:bg-[#333]">
|
|
598
621
|
```
|
|
599
622
|
|
|
600
|
-
###
|
|
623
|
+
### Binding
|
|
601
624
|
|
|
602
|
-
|
|
625
|
+
Rules are injected as Mancha renders the classes, so custom values work in the `class` attribute and in `:class` alike, including values that only appear after a state change.
|
|
603
626
|
|
|
604
|
-
|
|
605
|
-
<!-- ✓ Works -->
|
|
606
|
-
<div class="w-[133px]">
|
|
627
|
+
Markup that Mancha did not render is the exception: it is never scanned, so call `scanAndInject(root)` after inserting it yourself.
|
|
607
628
|
|
|
608
|
-
|
|
609
|
-
<div :class="'w-[133px]'">
|
|
610
|
-
<div :attr:style="'width: ' + dynamicWidth">
|
|
611
|
-
```
|
|
629
|
+
### Limitations
|
|
612
630
|
|
|
613
631
|
**Browser only**: Custom values require the CSSStyleSheet API and are not available in Worker or SSR environments.
|
|
614
632
|
|
|
@@ -621,7 +639,21 @@ Custom values support pseudo-states, responsive breakpoints, and dark mode:
|
|
|
621
639
|
|
|
622
640
|
### Dynamic Content
|
|
623
641
|
|
|
624
|
-
|
|
642
|
+
Content rendered by Mancha is scanned automatically. Markup produced by anything else (raw `innerHTML`, a third-party widget) is not, so scan it yourself with `scanAndInject(root)`:
|
|
643
|
+
|
|
644
|
+
```js
|
|
645
|
+
import { scanAndInject } from "mancha/browser";
|
|
646
|
+
|
|
647
|
+
widget.mount(container); // Third-party code writes into the container.
|
|
648
|
+
scanAndInject(container);
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
Re-scanning an already-scanned tree is safe: each rule is injected once, and rules are re-injected if the stylesheet element is removed from the document.
|
|
652
|
+
|
|
653
|
+
Two limitations:
|
|
654
|
+
|
|
655
|
+
- **ESM only**: `scanAndInject` is exported from the module build, not from the global bundle loaded via a `<script>` tag.
|
|
656
|
+
- **No shadow DOM**: `querySelectorAll` does not pierce a shadow root, so scanning a host element finds nothing inside it. Scanning the shadow root itself does inject rules, but they land in the main document's stylesheet, where shadow-boundary scoping stops them from applying. Style shadow content with its own stylesheet instead.
|
|
625
657
|
|
|
626
658
|
---
|
|
627
659
|
|