@andrilla/mado-ui 1.0.7 → 1.0.9
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 +751 -12
- package/dist/client/components/index.js +951 -664
- package/dist/client/graphics/index.js +2 -11
- package/dist/client.js +947 -665
- package/dist/components/drop-down.d.ts +4 -4
- package/dist/components/fieldset.d.ts +7 -0
- package/dist/components/index.js +950 -663
- package/dist/components/link.d.ts +14 -10
- package/dist/components/modal.d.ts +9 -6
- package/dist/components/select.d.ts +2 -1
- package/dist/components/time.d.ts +3 -1
- package/dist/css/base.css +0 -28
- package/dist/css/index.css +0 -1
- package/dist/css/tailwindcss.css +2 -0
- package/dist/css/theme.css +10 -0
- package/dist/css/utilities.css +26 -0
- package/dist/graphics/index.js +1 -10
- package/dist/hooks/index.js +1 -5
- package/dist/index.js +946 -664
- package/dist/types.d.ts +5 -8
- package/dist/utils/get-theme-color.d.ts +3 -0
- package/dist/utils/index.js +1 -8
- package/package.json +28 -15
package/README.md
CHANGED
|
@@ -46,22 +46,28 @@ deno add npm:@andrilla/mado-ui
|
|
|
46
46
|
Import CSS above your tailwind import in your `globals.css`.
|
|
47
47
|
|
|
48
48
|
```css
|
|
49
|
+
@import 'tailwindcss';
|
|
49
50
|
@import '@andrilla/mado-ui/css';
|
|
50
51
|
```
|
|
51
52
|
|
|
53
|
+
It's important to import `tailwindcss` before `@andrilla/mado-ui/css`, or you can just import `@andrilla/mado-ui/tailwindcss` which has `tailwindcss` already imported.
|
|
54
|
+
|
|
55
|
+
[See CSS Changes](#css-changes)
|
|
56
|
+
|
|
52
57
|
## Components
|
|
53
58
|
|
|
54
59
|
### Button
|
|
55
60
|
|
|
56
|
-
A pre-styled button component with utility props for easy customization.
|
|
57
|
-
|
|
61
|
+
A pre-styled button component built on Headless UI's Button. with utility props for easy customization.
|
|
62
|
+
Doubles as an `HTMLButtonElement` and `HTMLAnchorElement`.
|
|
58
63
|
|
|
59
64
|
Default export:
|
|
60
65
|
|
|
61
66
|
- Button
|
|
62
67
|
|
|
63
|
-
Props include `padding`, `rounded`, `theme
|
|
64
|
-
|
|
68
|
+
Props include `padding`, `rounded`, `theme`. Just add `href` to make it an `HTMLAnchorElement`.
|
|
69
|
+
|
|
70
|
+
[Note About Theme](#note-about-theme)
|
|
65
71
|
|
|
66
72
|
#### Example
|
|
67
73
|
|
|
@@ -70,7 +76,7 @@ attributes.
|
|
|
70
76
|
Click me
|
|
71
77
|
</Button>
|
|
72
78
|
|
|
73
|
-
<Button href="/about" theme="blue" gradient>
|
|
79
|
+
<Button href="/about" theme="blue-800" gradient>
|
|
74
80
|
Link Button
|
|
75
81
|
</Button>
|
|
76
82
|
```
|
|
@@ -79,39 +85,148 @@ attributes.
|
|
|
79
85
|
|
|
80
86
|
Just a form component with `className="grid gap-3"`.
|
|
81
87
|
|
|
88
|
+
#### Example
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<Form>
|
|
92
|
+
<Input
|
|
93
|
+
name='email'
|
|
94
|
+
label='Email'
|
|
95
|
+
placeholder='example@email.com'
|
|
96
|
+
type='email'
|
|
97
|
+
/>
|
|
98
|
+
|
|
99
|
+
<SubmitButton>Submit</SubmitButton>
|
|
100
|
+
</Form>
|
|
101
|
+
```
|
|
102
|
+
|
|
82
103
|
### Ghost
|
|
83
104
|
|
|
84
105
|
A loading placeholder component with animated pulse effect.
|
|
85
106
|
|
|
107
|
+
#### Example
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
<Ghost />
|
|
111
|
+
```
|
|
112
|
+
|
|
86
113
|
### Heading
|
|
87
114
|
|
|
88
115
|
A heading component that renders HTML heading elements (h1-h6) with appropriate
|
|
89
|
-
styling. Automatically generates IDs for targeting. Defaults to `h2`.
|
|
116
|
+
styling. Automatically generates IDs for targeting, similar to a markdown. Defaults to `h2`.
|
|
117
|
+
|
|
118
|
+
#### Example
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
<Heading as='h1'>Work Hard and Reap the Rewards</Heading>
|
|
122
|
+
|
|
123
|
+
<Heading>Some times things aren't as they seem.</Heading>
|
|
124
|
+
```
|
|
90
125
|
|
|
91
126
|
### Input
|
|
92
127
|
|
|
93
|
-
A form input component with built-in validation CSS,
|
|
128
|
+
A form input component built on Headless UI's Input wrapped in Headless UI's Field with built-in validation CSS, label (Headless UI Label), description (Headless UI Description), and children for custom content like tooltips. Required by default.
|
|
129
|
+
|
|
130
|
+
#### Example
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
<Input name='first_name' label='First Name' placeholder='First Name' />
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Textarea
|
|
137
|
+
|
|
138
|
+
Same setup as Input, but for textarea built on Headless UI's Textarea. Includes `resize` prop for controlling resize behavior (because the CSS can be confusing). Required by default.
|
|
139
|
+
|
|
140
|
+
#### Example
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
<Textarea name='message' label='Message' placeholder='Your message…' />
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Checkbox
|
|
147
|
+
|
|
148
|
+
Same setup as Input, but for checkbox built on Headless UI's Checkbox.
|
|
149
|
+
|
|
150
|
+
#### Example
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
<Checkbox name='terms' label='I agree to the terms and conditions' />
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Select
|
|
157
|
+
|
|
158
|
+
Same setup as Input, but for select built on Headless UI's Listbox. Uses uncontrolled state by default. Works great with `multiple` prop for multi-select.
|
|
159
|
+
|
|
160
|
+
#### SelectOption
|
|
161
|
+
|
|
162
|
+
Add options to your Select component built on Headless UI's ListboxOption. Designed to have customizable children, to display unique option values (e.g. icons, descriptions, etc.), while displaying just the option name in the select box.
|
|
163
|
+
|
|
164
|
+
#### Example
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
<Select label='Do you like good design?'>
|
|
168
|
+
<SelectOption name='YES!' value='yes'>
|
|
169
|
+
<ThumbsUp />
|
|
170
|
+
YES!
|
|
171
|
+
</SelectOption>
|
|
172
|
+
|
|
173
|
+
<SelectOption name='Nah' value='no'>
|
|
174
|
+
<ThumbsDown />
|
|
175
|
+
Nah. Bad design is better.
|
|
176
|
+
</SelectOption>
|
|
177
|
+
</Select>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Fieldset
|
|
181
|
+
|
|
182
|
+
A form fieldset component built on Headless UI's Fieldset with built-in legend (Headless UI Legend).
|
|
183
|
+
|
|
184
|
+
#### Example
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
<Fieldset legend='Legend'>
|
|
188
|
+
<Input name='first_name' label='First Name' placeholder='First Name' />
|
|
189
|
+
|
|
190
|
+
<Input name='last_name' label='Last Name' placeholder='Last Name' />
|
|
191
|
+
</Fieldset>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Anchor
|
|
195
|
+
|
|
196
|
+
A link component that removes hashes after scrolling to anchor points, and adds a scale down on click. Generally you should use the `Link` component, but this is good for wrapping images or other non-text content. _Don't forget to make it accessible by adding a `title` attribute, an sr-only `span`, or `aria-label`._
|
|
197
|
+
|
|
198
|
+
#### Example
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
<Anchor href='#section' title='go somewhere else'>
|
|
202
|
+
<svg viewBox='0 0 100 100'>
|
|
203
|
+
<circle cx='50' cy='50' r='50' />
|
|
204
|
+
</svg>
|
|
205
|
+
</Anchor>
|
|
206
|
+
```
|
|
94
207
|
|
|
95
208
|
### Link
|
|
96
209
|
|
|
97
210
|
A link component with various animation styles and theming options. Supports
|
|
98
|
-
both single-line and multiline text.
|
|
211
|
+
both single-line and multiline text.
|
|
212
|
+
|
|
213
|
+
[Note About Theme](#note-about-theme)
|
|
99
214
|
|
|
100
215
|
#### Example
|
|
101
216
|
|
|
102
217
|
```tsx
|
|
103
|
-
<Link href="/about"
|
|
218
|
+
<Link href="/about" lineType="ltr" theme="mauve">
|
|
104
219
|
Learn more
|
|
105
220
|
</Link>
|
|
106
221
|
|
|
107
|
-
<Link href="/contact"
|
|
222
|
+
<Link href="/contact" lineType="multiline-fill-center" theme="cyan">
|
|
108
223
|
Get in touch
|
|
109
224
|
</Link>
|
|
110
225
|
```
|
|
111
226
|
|
|
112
227
|
### Modal
|
|
113
228
|
|
|
114
|
-
A pre-designed modal component built on
|
|
229
|
+
A pre-designed modal component built on Headless UI's Dialog. Handles transitions,
|
|
115
230
|
drag-to-close functionality, and backdrop interactions.
|
|
116
231
|
|
|
117
232
|
#### Example
|
|
@@ -119,8 +234,10 @@ drag-to-close functionality, and backdrop interactions.
|
|
|
119
234
|
```tsx
|
|
120
235
|
<Modal>
|
|
121
236
|
<ModalTrigger>Open Modal</ModalTrigger>
|
|
237
|
+
|
|
122
238
|
<ModalDialog>
|
|
123
239
|
<ModalTitle>Modal Content</ModalTitle>
|
|
240
|
+
|
|
124
241
|
<ModalDescription>This is the modal content.</ModalDescription>
|
|
125
242
|
</ModalDialog>
|
|
126
243
|
</Modal>
|
|
@@ -135,7 +252,6 @@ A specialized button for form submission with status-aware styling and content.
|
|
|
135
252
|
```tsx
|
|
136
253
|
<SubmitButton
|
|
137
254
|
formStatus={formStatus}
|
|
138
|
-
loading='Submitting…'
|
|
139
255
|
success='Form Submitted!'
|
|
140
256
|
error='Submission Failed'
|
|
141
257
|
>
|
|
@@ -143,6 +259,138 @@ A specialized button for form submission with status-aware styling and content.
|
|
|
143
259
|
</SubmitButton>
|
|
144
260
|
```
|
|
145
261
|
|
|
262
|
+
### Human Verification
|
|
263
|
+
|
|
264
|
+
A bot-preventing submission method, forcing an iOS 5 like 'swipe to verify' gesture. This can be used in place of a submit button or as an additional layer of security.
|
|
265
|
+
|
|
266
|
+
This is still in beta, due to potential accessibility issues, despite included keyboard support. It also includes token generation and verification, although additional server-side verification API is not supported yet.
|
|
267
|
+
|
|
268
|
+
#### Example
|
|
269
|
+
|
|
270
|
+
```tsx
|
|
271
|
+
<Form>
|
|
272
|
+
<HumanVerification />
|
|
273
|
+
</Form>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Details
|
|
277
|
+
|
|
278
|
+
A pre-designed extension of Headless UI's Disclosure.
|
|
279
|
+
|
|
280
|
+
#### DetailsSummary
|
|
281
|
+
|
|
282
|
+
A pre-designed extension of Headless UI's DisclosureButton, that utilizes the Mado UI Button component.
|
|
283
|
+
|
|
284
|
+
#### DetailsBody
|
|
285
|
+
|
|
286
|
+
A pre-designed extension of Headless UI's DisclosurePanel.
|
|
287
|
+
|
|
288
|
+
#### Example
|
|
289
|
+
|
|
290
|
+
```tsx
|
|
291
|
+
<Details>
|
|
292
|
+
<DetailsSummary>What is an American Cardinal?</DetailsSummary>
|
|
293
|
+
|
|
294
|
+
<DetailsBody>
|
|
295
|
+
An American Cardinal is a bird. Male cardinals have a bright red breast and
|
|
296
|
+
a black face mask. Female cardinals have a duller brown coloration. This
|
|
297
|
+
allows the male cardinals to draw attention to themselves and away from
|
|
298
|
+
their mates, as their mates blend in with the trees.
|
|
299
|
+
</DetailsBody>
|
|
300
|
+
</Details>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### DropDown
|
|
304
|
+
|
|
305
|
+
A pre-designed extension of Headless UI's Menu.
|
|
306
|
+
|
|
307
|
+
#### DropDownButton
|
|
308
|
+
|
|
309
|
+
An extension of Headless UI's MenuButton.
|
|
310
|
+
|
|
311
|
+
#### DropDownItems
|
|
312
|
+
|
|
313
|
+
A pre-designed extension of Headless UI's MenuItems.
|
|
314
|
+
|
|
315
|
+
#### DropDownItem
|
|
316
|
+
|
|
317
|
+
An extension of Headless UI's MenuItem.
|
|
318
|
+
|
|
319
|
+
#### DropDownSection
|
|
320
|
+
|
|
321
|
+
An extension of Headless UI's MenuSection with a built-in `label` prop that utilizes a pre-designed extension of Headless UI's MenuHeading and optional `separatorAbove` and `separatorBelow` props to automatically add separators around the section with `DropDownSeparator`.
|
|
322
|
+
|
|
323
|
+
#### DropDownSeparator
|
|
324
|
+
|
|
325
|
+
An pre-designed extension of Headless UI's MenuSeparator.
|
|
326
|
+
|
|
327
|
+
#### Example
|
|
328
|
+
|
|
329
|
+
```tsx
|
|
330
|
+
<DropDown>
|
|
331
|
+
<DropDownButton>Actions</DropDownButton>
|
|
332
|
+
|
|
333
|
+
<DropDownItems>
|
|
334
|
+
<DropDownSection label='Edit'>
|
|
335
|
+
<DropDownItem>Edit</DropDownItem>
|
|
336
|
+
|
|
337
|
+
<DropDownItem>Copy</DropDownItem>
|
|
338
|
+
|
|
339
|
+
<DropDownItem>Paste</DropDownItem>
|
|
340
|
+
</DropDownSection>
|
|
341
|
+
|
|
342
|
+
<DropDownSection label='Share' separatorAbove>
|
|
343
|
+
<DropDownItem>Share</DropDownItem>
|
|
344
|
+
|
|
345
|
+
<DropDownItem>Download</DropDownItem>
|
|
346
|
+
</DropDownSection>
|
|
347
|
+
|
|
348
|
+
<DropDownSeparator />
|
|
349
|
+
|
|
350
|
+
<DropDownSection label='Help'>
|
|
351
|
+
<DropDownItem>Quick Tips</DropDownItem>
|
|
352
|
+
|
|
353
|
+
<DropDownItem>Docs</DropDownItem>
|
|
354
|
+
</DropDownSection>
|
|
355
|
+
</DropDownItems>
|
|
356
|
+
</DropDown>
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Tooltip
|
|
360
|
+
|
|
361
|
+
A tooltip component that displays a tooltip on hover or focus.
|
|
362
|
+
|
|
363
|
+
#### TooltipTrigger
|
|
364
|
+
|
|
365
|
+
The trigger element that opens the tooltip on hover or focus.
|
|
366
|
+
|
|
367
|
+
#### TooltipDisplay
|
|
368
|
+
|
|
369
|
+
The element that is the tooltip content.
|
|
370
|
+
|
|
371
|
+
#### Example
|
|
372
|
+
|
|
373
|
+
```tsx
|
|
374
|
+
<Tooltip>
|
|
375
|
+
<TooltipTrigger>More details</TooltipTrigger>
|
|
376
|
+
|
|
377
|
+
<TooltipDisplay>
|
|
378
|
+
This is helpful for showing additional information about the trigger
|
|
379
|
+
element.
|
|
380
|
+
</TooltipDisplay>
|
|
381
|
+
</Tooltip>
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### IFrame
|
|
385
|
+
|
|
386
|
+
An iframe component with better built-in type safety and required `title` prop for accessibility and SEO.
|
|
387
|
+
|
|
388
|
+
#### Example
|
|
389
|
+
|
|
390
|
+
```tsx
|
|
391
|
+
<IFrame src='https://andrilla.net' title={`Andrilla's website`} />
|
|
392
|
+
```
|
|
393
|
+
|
|
146
394
|
### Time
|
|
147
395
|
|
|
148
396
|
A time component that displays formatted dates and times with customizable
|
|
@@ -152,5 +400,496 @@ precision.
|
|
|
152
400
|
|
|
153
401
|
```tsx
|
|
154
402
|
<Time dateObject={new Date()} day month year hours minutes />
|
|
403
|
+
|
|
155
404
|
<Time dateTime='2024-01-01T12:00:00Z' />
|
|
156
405
|
```
|
|
406
|
+
|
|
407
|
+
### Video
|
|
408
|
+
|
|
409
|
+
It is a video component with some nice built-in features, but it's still better to go with Vimeo. The progressive enhancement needs some work before it's ready for production.
|
|
410
|
+
|
|
411
|
+
## CSS Changes
|
|
412
|
+
|
|
413
|
+
To help create better design with less work, there are some changes to the Tailwind base that you should be aware of. There are also some additions to the theme and some helpful utility classes that may prove useful.
|
|
414
|
+
|
|
415
|
+
### Base
|
|
416
|
+
|
|
417
|
+
```css
|
|
418
|
+
@layer base {
|
|
419
|
+
/* Inputs have a min-width by default which makes working with them confusing. We removed that to make them easier to work with. A relative position is generally preferred over static, since absolute positioning outside of a direct parent is a rarity, and can be easily changed with the static class. */
|
|
420
|
+
* {
|
|
421
|
+
position: relative;
|
|
422
|
+
min-width: 0;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/* Helps differentiate paragraphs from headings, and makes it pretty. */
|
|
426
|
+
p {
|
|
427
|
+
color: color-mix(in oklch, currentColor 80%, transparent);
|
|
428
|
+
text-wrap: pretty;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/* We think this is a better default for users. */
|
|
432
|
+
button {
|
|
433
|
+
cursor: pointer;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/* Aligns svgs without defined colors with the currentColor. */
|
|
437
|
+
svg {
|
|
438
|
+
fill: currentColor;
|
|
439
|
+
stroke: currentColor;
|
|
440
|
+
stroke-width: 0;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### Theme
|
|
446
|
+
|
|
447
|
+
```css
|
|
448
|
+
@theme {
|
|
449
|
+
/* This is used for the Tooltip. It's very straightforward. */
|
|
450
|
+
--animate-fade-in: fade-in var(--tw-animation-duration, 0.2s)
|
|
451
|
+
var(--tw-animation-timing-function, cubic-bezier(0.25, 0.5, 0, 0.99))
|
|
452
|
+
var(--tw-animation-fill-mode, forwards);
|
|
453
|
+
|
|
454
|
+
@keyframes fade-in {
|
|
455
|
+
from {
|
|
456
|
+
opacity: 0;
|
|
457
|
+
}
|
|
458
|
+
to {
|
|
459
|
+
opacity: 1;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/* This is used for the loading state of the SubmitButton. Pair this with animation-delay on adjacent elements to see the wave. */
|
|
464
|
+
--animate-wave: wave var(--tw-animation-duration, 3s)
|
|
465
|
+
var(--tw-animation-timing-function, ease-in-out)
|
|
466
|
+
var(--tw-animation-iteration-count, infinite);
|
|
467
|
+
|
|
468
|
+
@keyframes wave {
|
|
469
|
+
0%,
|
|
470
|
+
15%,
|
|
471
|
+
85%,
|
|
472
|
+
100% {
|
|
473
|
+
transform: translateY(0);
|
|
474
|
+
}
|
|
475
|
+
35% {
|
|
476
|
+
transform: translateY(-3px);
|
|
477
|
+
}
|
|
478
|
+
65% {
|
|
479
|
+
transform: translateY(3px);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/* For the added animation utilities. */
|
|
484
|
+
--animation-direction-normal: normal;
|
|
485
|
+
--animation-direction-reverse: reverse;
|
|
486
|
+
--animation-direction-alternate: alternate;
|
|
487
|
+
--animation-direction-alternate-reverse: alternate-reverse;
|
|
488
|
+
|
|
489
|
+
--animation-fill-none: none;
|
|
490
|
+
--animation-fill-forwards: forwards;
|
|
491
|
+
--animation-fill-backwards: backwards;
|
|
492
|
+
--animation-fill-both: both;
|
|
493
|
+
|
|
494
|
+
--animation-iteration-infinite: infinite;
|
|
495
|
+
|
|
496
|
+
--animation-range-start-contain: contain;
|
|
497
|
+
--animation-range-start-cover: cover;
|
|
498
|
+
--animation-range-start-normal: normal;
|
|
499
|
+
|
|
500
|
+
--animation-state-paused: paused;
|
|
501
|
+
--animation-state-running: running;
|
|
502
|
+
|
|
503
|
+
/* Most of the time the theme color of buttons and links should match your branding. Reset the --base-theme-color (and optionally the --base-theme-color--foreground) in your @theme to automatically match the default theme color to your brand, without having to reset it on each button and link manually. */
|
|
504
|
+
--base-theme-color: var(--color-blue-500);
|
|
505
|
+
--base-theme-color--foreground: color-mix(
|
|
506
|
+
in oklch,
|
|
507
|
+
var(--base-theme-color) 5%,
|
|
508
|
+
var(--color-white)
|
|
509
|
+
);
|
|
510
|
+
|
|
511
|
+
/* For the added corner-shape-* utility. */
|
|
512
|
+
--corner-shape-bevel: bevel;
|
|
513
|
+
--corner-shape-notch: notch;
|
|
514
|
+
--corner-shape-round: round;
|
|
515
|
+
--corner-shape-scoop: scoop;
|
|
516
|
+
--corner-shape-square: square;
|
|
517
|
+
--corner-shape-squircle: squircle;
|
|
518
|
+
--corner-shape-infinity: superellipse(infinity);
|
|
519
|
+
|
|
520
|
+
/* Exponential easing feels more responsive than other easing methods. */
|
|
521
|
+
--ease-exponential: cubic-bezier(0.25, 0.5, 0, 0.99);
|
|
522
|
+
/* Spring easing provides a bouncy feel without the need for JavaScript. */
|
|
523
|
+
--ease-spring: cubic-bezier(0.35, 1.67, 0.44, 0.78);
|
|
524
|
+
|
|
525
|
+
/* You may want to modify these, or the neutral colors, to fit the branding of your website. These are primarily used to assist with ring offsets. Add these to the body of your @layer base to take full advantage of them. */
|
|
526
|
+
--global-bg: light-dark(var(--color-neutral-50), var(--color-neutral-900));
|
|
527
|
+
--global-text: light-dark(var(--color-neutral-950), var(--color-neutral-100));
|
|
528
|
+
|
|
529
|
+
/* Helpful relative font sizing. */
|
|
530
|
+
--text-smaller: smaller;
|
|
531
|
+
--text-larger: larger;
|
|
532
|
+
}
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
```css
|
|
536
|
+
/* Animation utility classes that do what you think they do. */
|
|
537
|
+
@utility animation-delay-* {
|
|
538
|
+
--tw-animation-delay: --value([*]);
|
|
539
|
+
/* prettier-ignore */
|
|
540
|
+
--tw-animation-delay: --value(integer)ms;
|
|
541
|
+
animation-delay: var(--tw-animation-delay);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
@utility animation-direction-* {
|
|
545
|
+
--tw-animation-direction: --value(--animation-direction-*);
|
|
546
|
+
animation-direction: var(--tw-animation-direction);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
@utility animation-duration-* {
|
|
550
|
+
--tw-animation-duration: --value([*]);
|
|
551
|
+
/* prettier-ignore */
|
|
552
|
+
--tw-animation-duration: --value(integer)ms;
|
|
553
|
+
animation-duration: var(--tw-animation-duration);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
@utility animation-ease-* {
|
|
557
|
+
--tw-animation-timing-function: --value(--ease-*, [*]);
|
|
558
|
+
animation-timing-function: var(--tw-animation-timing-function);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
@utility animation-fill-* {
|
|
562
|
+
--tw-animation-fill-mode: --value(--animation-fill-*);
|
|
563
|
+
animation-fill-mode: var(--tw-animation-fill-mode);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
@utility animation-iteration-* {
|
|
567
|
+
--tw-animation-iteration-count: --value(--animation-iteration-*, integer);
|
|
568
|
+
animation-iteration-count: var(--tw-animation-iteration-count);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
@utility animation-start-* {
|
|
572
|
+
--tw-animation-range-start: --value(--animation-range-start-*, [*]);
|
|
573
|
+
/* prettier-ignore */
|
|
574
|
+
--tw-animation-range-start: --value(number)px;
|
|
575
|
+
--tw-animation-range-start: --value(percentage);
|
|
576
|
+
animation-range-start: var(--tw-animation-range-start);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
@utility animation-state-* {
|
|
580
|
+
--tw-animation-state: --value(--animation-state-*);
|
|
581
|
+
animation-play-state: var(--tw-animation-state);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/* All various corner-shape options. Not supported in all browsers yet, but we added it to Button, so now it's future-proofed. Use `corner-super-1.5` for a superellipse that looks good with or without browser support. */
|
|
585
|
+
@utility corner-* {
|
|
586
|
+
corner-shape: --value(--corner-shape-*, [*]);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
@utility corner-s-* {
|
|
590
|
+
corner-start-start-shape: --value(--corner-shape-*, [*]);
|
|
591
|
+
corner-end-start-shape: --value(--corner-shape-*, [*]);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
@utility corner-e-* {
|
|
595
|
+
corner-start-end-shape: --value(--corner-shape-*, [*]);
|
|
596
|
+
corner-end-end-shape: --value(--corner-shape-*, [*]);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
@utility corner-t-* {
|
|
600
|
+
corner-top-left-shape: --value(--corner-shape-*, [*]);
|
|
601
|
+
corner-top-right-shape: --value(--corner-shape-*, [*]);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
@utility corner-r-* {
|
|
605
|
+
corner-top-right-shape: --value(--corner-shape-*, [*]);
|
|
606
|
+
corner-bottom-right-shape: --value(--corner-shape-*, [*]);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
@utility corner-b-* {
|
|
610
|
+
corner-bottom-left-shape: --value(--corner-shape-*, [*]);
|
|
611
|
+
corner-bottom-right-shape: --value(--corner-shape-*, [*]);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
@utility corner-l-* {
|
|
615
|
+
corner-top-left-shape: --value(--corner-shape-*, [*]);
|
|
616
|
+
corner-bottom-left-shape: --value(--corner-shape-*, [*]);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
@utility corner-ss-* {
|
|
620
|
+
corner-start-start-shape: --value(--corner-shape-*, [*]);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
@utility corner-se-* {
|
|
624
|
+
corner-start-end-shape: --value(--corner-shape-*, [*]);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
@utility corner-es-* {
|
|
628
|
+
corner-end-start-shape: --value(--corner-shape-*, [*]);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
@utility corner-tl-* {
|
|
632
|
+
corner-top-left-shape: --value(--corner-shape-*, [*]);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
@utility corner-tr-* {
|
|
636
|
+
corner-top-right-shape: --value(--corner-shape-*, [*]);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
@utility corner-br-* {
|
|
640
|
+
corner-bottom-right-shape: --value(--corner-shape-*, [*]);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
@utility corner-bl-* {
|
|
644
|
+
corner-bottom-left-shape: --value(--corner-shape-*, [*]);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
@utility -corner-infinity {
|
|
648
|
+
corner-shape: superellipse(-infinity);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
@utility -corner-s-infinity {
|
|
652
|
+
corner-start-start-shape: superellipse(-infinity);
|
|
653
|
+
corner-end-start-shape: superellipse(-infinity);
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
@utility -corner-e-infinity {
|
|
657
|
+
corner-start-end-shape: superellipse(-infinity);
|
|
658
|
+
corner-end-end-shape: superellipse(-infinity);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
@utility -corner-t-infinity {
|
|
662
|
+
corner-top-left-shape: superellipse(-infinity);
|
|
663
|
+
corner-top-right-shape: superellipse(-infinity);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
@utility -corner-r-infinity {
|
|
667
|
+
corner-top-right-shape: superellipse(-infinity);
|
|
668
|
+
corner-bottom-right-shape: superellipse(-infinity);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
@utility -corner-b-infinity {
|
|
672
|
+
corner-bottom-left-shape: superellipse(-infinity);
|
|
673
|
+
corner-bottom-right-shape: superellipse(-infinity);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
@utility -corner-l-infinity {
|
|
677
|
+
corner-top-left-shape: superellipse(-infinity);
|
|
678
|
+
corner-bottom-left-shape: superellipse(-infinity);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
@utility -corner-ss-infinity {
|
|
682
|
+
corner-start-start-shape: superellipse(-infinity);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
@utility -corner-se-infinity {
|
|
686
|
+
corner-start-end-shape: superellipse(-infinity);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
@utility -corner-es-infinity {
|
|
690
|
+
corner-end-start-shape: superellipse(-infinity);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
@utility -corner-tl-infinity {
|
|
694
|
+
corner-top-left-shape: superellipse(-infinity);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
@utility -corner-tr-infinity {
|
|
698
|
+
corner-top-right-shape: superellipse(-infinity);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
@utility -corner-br-infinity {
|
|
702
|
+
corner-bottom-right-shape: superellipse(-infinity);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
@utility -corner-bl-infinity {
|
|
706
|
+
corner-bottom-left-shape: superellipse(-infinity);
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
@utility corner-super-* {
|
|
710
|
+
corner-shape: superellipse(--value(number));
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
@utility corner-s-super-* {
|
|
714
|
+
corner-start-start-shape: superellipse(--value(number));
|
|
715
|
+
corner-end-start-shape: superellipse(--value(number));
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
@utility corner-e-super-* {
|
|
719
|
+
corner-start-end-shape: superellipse(--value(number));
|
|
720
|
+
corner-end-end-shape: superellipse(--value(number));
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
@utility corner-t-super-* {
|
|
724
|
+
corner-top-left-shape: superellipse(--value(number));
|
|
725
|
+
corner-top-right-shape: superellipse(--value(number));
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
@utility corner-r-super-* {
|
|
729
|
+
corner-top-right-shape: superellipse(--value(number));
|
|
730
|
+
corner-bottom-right-shape: superellipse(--value(number));
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
@utility corner-b-super-* {
|
|
734
|
+
corner-bottom-left-shape: superellipse(--value(number));
|
|
735
|
+
corner-bottom-right-shape: superellipse(--value(number));
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
@utility corner-l-super-* {
|
|
739
|
+
corner-top-left-shape: superellipse(--value(number));
|
|
740
|
+
corner-bottom-left-shape: superellipse(--value(number));
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
@utility corner-ss-super-* {
|
|
744
|
+
corner-start-start-shape: superellipse(--value(number));
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
@utility corner-se-super-* {
|
|
748
|
+
corner-start-end-shape: superellipse(--value(number));
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
@utility corner-es-super-* {
|
|
752
|
+
corner-end-start-shape: superellipse(--value(number));
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
@utility corner-tl-super-* {
|
|
756
|
+
corner-top-left-shape: superellipse(--value(number));
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
@utility corner-tr-super-* {
|
|
760
|
+
corner-top-right-shape: superellipse(--value(number));
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
@utility corner-br-super-* {
|
|
764
|
+
corner-bottom-right-shape: superellipse(--value(number));
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
@utility corner-bl-super-* {
|
|
768
|
+
corner-bottom-left-shape: superellipse(--value(number));
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
@utility -corner-super-* {
|
|
772
|
+
corner-shape: superellipse(calc(--value(number) * -1));
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
@utility -corner-s-super-* {
|
|
776
|
+
corner-start-start-shape: superellipse(calc(--value(number) * -1));
|
|
777
|
+
corner-end-start-shape: superellipse(calc(--value(number) * -1));
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
@utility -corner-e-super-* {
|
|
781
|
+
corner-start-end-shape: superellipse(calc(--value(number) * -1));
|
|
782
|
+
corner-end-end-shape: superellipse(calc(--value(number) * -1));
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
@utility -corner-t-super-* {
|
|
786
|
+
corner-top-left-shape: superellipse(calc(--value(number) * -1));
|
|
787
|
+
corner-top-right-shape: superellipse(calc(--value(number) * -1));
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
@utility -corner-r-super-* {
|
|
791
|
+
corner-top-right-shape: superellipse(calc(--value(number) * -1));
|
|
792
|
+
corner-bottom-right-shape: superellipse(calc(--value(number) * -1));
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
@utility -corner-b-super-* {
|
|
796
|
+
corner-bottom-left-shape: superellipse(calc(--value(number) * -1));
|
|
797
|
+
corner-bottom-right-shape: superellipse(calc(--value(number) * -1));
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
@utility -corner-l-super-* {
|
|
801
|
+
corner-top-left-shape: superellipse(calc(--value(number) * -1));
|
|
802
|
+
corner-bottom-left-shape: superellipse(calc(--value(number) * -1));
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
@utility -corner-ss-super-* {
|
|
806
|
+
corner-start-start-shape: superellipse(calc(--value(number) * -1));
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
@utility -corner-se-super-* {
|
|
810
|
+
corner-start-end-shape: superellipse(calc(--value(number) * -1));
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
@utility -corner-es-super-* {
|
|
814
|
+
corner-end-start-shape: superellipse(calc(--value(number) * -1));
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
@utility -corner-tl-super-* {
|
|
818
|
+
corner-top-left-shape: superellipse(calc(--value(number) * -1));
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
@utility -corner-tr-super-* {
|
|
822
|
+
corner-top-right-shape: superellipse(calc(--value(number) * -1));
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
@utility -corner-br-super-* {
|
|
826
|
+
corner-bottom-right-shape: superellipse(calc(--value(number) * -1));
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
@utility -corner-bl-super-* {
|
|
830
|
+
corner-bottom-left-shape: superellipse(calc(--value(number) * -1));
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/* Makes it possible to utilize the same gap as parent elements without subgrid. */
|
|
834
|
+
@utility gap-* {
|
|
835
|
+
--tw-gap: --value([*]);
|
|
836
|
+
--tw-gap-x: --value([*]);
|
|
837
|
+
--tw-gap-y: --value([*]);
|
|
838
|
+
--tw-gap: calc(var(--spacing) * --value(number));
|
|
839
|
+
--tw-gap-x: var(--tw-gap, calc(var(--spacing) * --value(number)));
|
|
840
|
+
--tw-gap-y: var(--tw-gap, calc(var(--spacing) * --value(number)));
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
@utility gap-x-* {
|
|
844
|
+
--tw-gap-x: --value([*]);
|
|
845
|
+
--tw-gap-x: calc(var(--spacing) * --value(number));
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
@utility gap-y-* {
|
|
849
|
+
--tw-gap-y: --value([*]);
|
|
850
|
+
--tw-gap-y: calc(var(--spacing) * --value(number));
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/* Makes animating width relatively possible. */
|
|
854
|
+
@utility grid-cols-0fr {
|
|
855
|
+
grid-template-columns: 0fr;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
@utility grid-cols-1fr {
|
|
859
|
+
grid-template-columns: 1fr;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/* Makes animating height relatively possible. */
|
|
863
|
+
@utility grid-rows-0fr {
|
|
864
|
+
grid-template-rows: 0fr;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
@utility grid-rows-1fr {
|
|
868
|
+
grid-template-rows: 1fr;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/* Makes animating on hover or other pseudo states with grid-template-columns/rows easier. Meant to pair with the previous four grid-template utilities. */
|
|
872
|
+
@utility transition-cols {
|
|
873
|
+
transition-property: grid-template-columns;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
@utility transition-rows {
|
|
877
|
+
transition-property: grid-template-rows;
|
|
878
|
+
}
|
|
879
|
+
```
|
|
880
|
+
|
|
881
|
+
## Note About Theme
|
|
882
|
+
|
|
883
|
+
The `theme` prop includes all Tailwind CSS 4.2 colors by default, plus a `'custom'` value for defining custom themes. Built-in colors use shade `-500` by default, when writing `theme='blue'` for example. Built-in colors also have sensible defaults for foreground contrast, based on the chosen shade. 50-400 uses `color-mix(in oklch, var(--theme-color) 5%, var(--color-black))`, while 500-950 uses `color-mix(in oklch, var(--theme-color) 5%, var(--color-white))`. Using `'custom'` defaults to a light foreground, but you can add the following to change to a dark foreground:
|
|
884
|
+
|
|
885
|
+
### For Buttons
|
|
886
|
+
|
|
887
|
+
```tsx
|
|
888
|
+
'text-[color-mix(in_oklch,var(--theme-color)_5%,var(--color-black))]'
|
|
889
|
+
```
|
|
890
|
+
|
|
891
|
+
### For Links
|
|
892
|
+
|
|
893
|
+
```tsx
|
|
894
|
+
'[--text-color:color-mix(in_oklch,var(--theme-color)_5%,var(--color-black))]'
|
|
895
|
+
```
|