@once-ui-system/foundations 3.0.0-beta.0 → 3.0.0-beta.3
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/dist/css/styles.css +5 -1
- package/dist/css/styles.css.map +1 -1
- package/dist/css/tokens.css +5 -1
- package/dist/css/tokens.css.map +1 -1
- package/package.json +10 -4
- package/scss/styles/global.scss +7 -0
- package/scss/styles/glow.scss +28 -0
- package/scss/styles/grid.generated.scss +73 -73
- package/scss/styles/position.generated.scss +456 -456
- package/scss/styles/spacing.generated.scss +2058 -2058
- package/scss/styles/utilities.scss +86 -1
- package/scss/tokens/theme.scss +92 -22
- package/tailwind/tailwind.css +342 -0
- package/tokens/README.md +2 -1
- package/tokens/once-ui.tokens.json +65 -23
|
@@ -20,4 +20,89 @@
|
|
|
20
20
|
overflow: hidden;
|
|
21
21
|
text-overflow: ellipsis;
|
|
22
22
|
white-space: nowrap;
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
|
+
// Emphasis (`emphasis` on Flex and Grid): draws attention to an element.
|
|
25
|
+
// Every look starts from a colour edge that travels round the border (a conic
|
|
26
|
+
// gradient shown only on a thin ring, ::before); `glow` and `aura` add a halo
|
|
27
|
+
// on its own layer (::after), so it lights what is around the element and
|
|
28
|
+
// never its own face. Both sit under the content, inside the element's
|
|
29
|
+
// stacking context. Brand and accent come from the theme's function colours,
|
|
30
|
+
// so the edge stays coloured where the theme's solids are contrast.
|
|
31
|
+
//
|
|
32
|
+
// Tune it with custom properties on the element or an ancestor:
|
|
33
|
+
// --emphasis-from / --emphasis-to (colours), --emphasis-width (ring),
|
|
34
|
+
// --emphasis-duration (one turn).
|
|
35
|
+
|
|
36
|
+
@property --emphasis-angle {
|
|
37
|
+
syntax: "<angle>";
|
|
38
|
+
inherits: false;
|
|
39
|
+
initial-value: 0deg;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.fx-emphasis {
|
|
43
|
+
isolation: isolate;
|
|
44
|
+
|
|
45
|
+
&::before,
|
|
46
|
+
&::after {
|
|
47
|
+
content: "";
|
|
48
|
+
position: absolute;
|
|
49
|
+
inset: 0;
|
|
50
|
+
z-index: -1;
|
|
51
|
+
border-radius: inherit;
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// The edge. A whole-pixel ring: a fractional one rounds differently on
|
|
56
|
+
// opposite sides and reads thicker on top.
|
|
57
|
+
&::before {
|
|
58
|
+
padding: var(--emphasis-width, 1px);
|
|
59
|
+
background: conic-gradient(
|
|
60
|
+
from var(--emphasis-angle),
|
|
61
|
+
var(--emphasis-from, var(--function-brand-600)),
|
|
62
|
+
var(--emphasis-to, var(--function-accent-600)) 25%,
|
|
63
|
+
var(--brand-alpha-weak) 45%,
|
|
64
|
+
var(--brand-alpha-weak) 55%,
|
|
65
|
+
var(--emphasis-to, var(--function-accent-600)) 75%,
|
|
66
|
+
var(--emphasis-from, var(--function-brand-600))
|
|
67
|
+
);
|
|
68
|
+
-webkit-mask:
|
|
69
|
+
linear-gradient(#000 0 0) content-box,
|
|
70
|
+
linear-gradient(#000 0 0);
|
|
71
|
+
-webkit-mask-composite: xor;
|
|
72
|
+
mask:
|
|
73
|
+
linear-gradient(#000 0 0) content-box,
|
|
74
|
+
linear-gradient(#000 0 0);
|
|
75
|
+
mask-composite: exclude;
|
|
76
|
+
animation: emphasis-turn var(--emphasis-duration, 8s) linear infinite;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// With a border, the edge lies over it rather than just inside it.
|
|
80
|
+
&.border-1::before { inset: -1px; }
|
|
81
|
+
&.border-2::before { inset: -2px; }
|
|
82
|
+
&.border-4::before { inset: -4px; }
|
|
83
|
+
&.border-8::before { inset: -8px; }
|
|
84
|
+
|
|
85
|
+
// The halo. `edge` has none.
|
|
86
|
+
&.fx-emphasis-glow::after {
|
|
87
|
+
box-shadow: 0 0 40px -12px var(--emphasis-from, var(--function-brand-600));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.fx-emphasis-aura::after {
|
|
91
|
+
box-shadow:
|
|
92
|
+
0 0 96px -24px var(--emphasis-from, var(--function-brand-600)),
|
|
93
|
+
0 48px 140px -48px var(--emphasis-to, var(--function-accent-600));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media (prefers-reduced-motion: reduce) {
|
|
97
|
+
&::before {
|
|
98
|
+
animation: none;
|
|
99
|
+
--emphasis-angle: 45deg;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@keyframes emphasis-turn {
|
|
105
|
+
to {
|
|
106
|
+
--emphasis-angle: 360deg;
|
|
107
|
+
}
|
|
108
|
+
}
|
package/scss/tokens/theme.scss
CHANGED
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
--solid-inset-distance: 0;
|
|
30
30
|
--solid-inset-size: 0;
|
|
31
31
|
--solid-border-width: 0;
|
|
32
|
+
--solid-glow-near: 0rem;
|
|
33
|
+
--solid-glow-far: 0rem;
|
|
34
|
+
--solid-glow-near-mix: 0%;
|
|
35
|
+
--solid-glow-far-mix: 0%;
|
|
36
|
+
--solid-glow-rim: var(--static-transparent);
|
|
32
37
|
--backdrop-filter: none;
|
|
33
38
|
--surface-border: var(--static-transparent);
|
|
34
39
|
--surface-background: var(--neutral-background-medium);
|
|
@@ -399,9 +404,16 @@
|
|
|
399
404
|
--brand-border-medium: var(--function-brand-900);
|
|
400
405
|
--brand-border-weak: var(--function-brand-1000);
|
|
401
406
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
407
|
+
/* Alphas in light come from step 400, not 600 as in dark. Step 600 is a
|
|
408
|
+
light mid-tone: on a dark page it stands out, on #f9f9f9 or white it
|
|
409
|
+
barely shows (strong reached 1.6:1 against the page here, 2.4:1 in
|
|
410
|
+
dark). Step 400 at the same percentages gives light the weight dark
|
|
411
|
+
has: about 1.24, 1.57 and 2.23:1 for weak, medium and strong.
|
|
412
|
+
Brand, accent and the status colours use step 500 instead: step 400
|
|
413
|
+
is darker but greyer, and washed the hue out of tinted fills. */
|
|
414
|
+
--brand-alpha-strong: color-mix(in srgb, var(--function-brand-500) 50%, transparent);
|
|
415
|
+
--brand-alpha-medium: color-mix(in srgb, var(--function-brand-500) 30%, transparent);
|
|
416
|
+
--brand-alpha-weak: color-mix(in srgb, var(--function-brand-500) 15%, transparent);
|
|
405
417
|
|
|
406
418
|
/* See the dark block: the brand solids as data-solid="color" has them. */
|
|
407
419
|
--brand-color-strong: var(--function-brand-500);
|
|
@@ -429,9 +441,9 @@
|
|
|
429
441
|
--accent-border-medium: var(--function-accent-900);
|
|
430
442
|
--accent-border-weak: var(--function-accent-1000);
|
|
431
443
|
|
|
432
|
-
--accent-alpha-strong: var(--function-accent-
|
|
433
|
-
--accent-alpha-medium: var(--function-accent-
|
|
434
|
-
--accent-alpha-weak: var(--function-accent-
|
|
444
|
+
--accent-alpha-strong: color-mix(in srgb, var(--function-accent-500) 50%, transparent);
|
|
445
|
+
--accent-alpha-medium: color-mix(in srgb, var(--function-accent-500) 30%, transparent);
|
|
446
|
+
--accent-alpha-weak: color-mix(in srgb, var(--function-accent-500) 15%, transparent);
|
|
435
447
|
|
|
436
448
|
/* The page sits a step below its surfaces, as dark mode's does: an
|
|
437
449
|
off-white canvas with white cards on it, so layers read by elevation
|
|
@@ -460,9 +472,9 @@
|
|
|
460
472
|
--neutral-border-medium: var(--function-neutral-900);
|
|
461
473
|
--neutral-border-weak: var(--function-neutral-1000);
|
|
462
474
|
|
|
463
|
-
--neutral-alpha-strong: var(--function-neutral-
|
|
464
|
-
--neutral-alpha-medium: var(--function-neutral-
|
|
465
|
-
--neutral-alpha-weak: var(--function-neutral-
|
|
475
|
+
--neutral-alpha-strong: color-mix(in srgb, var(--function-neutral-400) 50%, transparent);
|
|
476
|
+
--neutral-alpha-medium: color-mix(in srgb, var(--function-neutral-400) 30%, transparent);
|
|
477
|
+
--neutral-alpha-weak: color-mix(in srgb, var(--function-neutral-400) 15%, transparent);
|
|
466
478
|
}
|
|
467
479
|
|
|
468
480
|
[data-theme="light"] {
|
|
@@ -502,9 +514,9 @@
|
|
|
502
514
|
--info-border-medium: var(--function-info-900);
|
|
503
515
|
--info-border-weak: var(--function-info-1000);
|
|
504
516
|
|
|
505
|
-
--info-alpha-strong: var(--function-info-
|
|
506
|
-
--info-alpha-medium: var(--function-info-
|
|
507
|
-
--info-alpha-weak: var(--function-info-
|
|
517
|
+
--info-alpha-strong: color-mix(in srgb, var(--function-info-400) 50%, transparent);
|
|
518
|
+
--info-alpha-medium: color-mix(in srgb, var(--function-info-400) 30%, transparent);
|
|
519
|
+
--info-alpha-weak: color-mix(in srgb, var(--function-info-400) 15%, transparent);
|
|
508
520
|
|
|
509
521
|
/* warning */
|
|
510
522
|
--warning-background-strong: var(--function-warning-800);
|
|
@@ -527,9 +539,9 @@
|
|
|
527
539
|
--warning-border-medium: var(--function-warning-900);
|
|
528
540
|
--warning-border-weak: var(--function-warning-1000);
|
|
529
541
|
|
|
530
|
-
--warning-alpha-strong: var(--function-warning-
|
|
531
|
-
--warning-alpha-medium: var(--function-warning-
|
|
532
|
-
--warning-alpha-weak: var(--function-warning-
|
|
542
|
+
--warning-alpha-strong: color-mix(in srgb, var(--function-warning-500) 50%, transparent);
|
|
543
|
+
--warning-alpha-medium: color-mix(in srgb, var(--function-warning-500) 30%, transparent);
|
|
544
|
+
--warning-alpha-weak: color-mix(in srgb, var(--function-warning-500) 15%, transparent);
|
|
533
545
|
|
|
534
546
|
/* danger */
|
|
535
547
|
--danger-background-strong: var(--function-danger-800);
|
|
@@ -552,9 +564,9 @@
|
|
|
552
564
|
--danger-border-medium: var(--function-danger-900);
|
|
553
565
|
--danger-border-weak: var(--function-danger-1000);
|
|
554
566
|
|
|
555
|
-
--danger-alpha-strong: var(--function-danger-
|
|
556
|
-
--danger-alpha-medium: var(--function-danger-
|
|
557
|
-
--danger-alpha-weak: var(--function-danger-
|
|
567
|
+
--danger-alpha-strong: color-mix(in srgb, var(--function-danger-500) 50%, transparent);
|
|
568
|
+
--danger-alpha-medium: color-mix(in srgb, var(--function-danger-500) 30%, transparent);
|
|
569
|
+
--danger-alpha-weak: color-mix(in srgb, var(--function-danger-500) 15%, transparent);
|
|
558
570
|
|
|
559
571
|
/* success */
|
|
560
572
|
--success-background-strong: var(--function-success-800);
|
|
@@ -577,9 +589,9 @@
|
|
|
577
589
|
--success-border-medium: var(--function-success-900);
|
|
578
590
|
--success-border-weak: var(--function-success-1000);
|
|
579
591
|
|
|
580
|
-
--success-alpha-strong: var(--function-success-
|
|
581
|
-
--success-alpha-medium: var(--function-success-
|
|
582
|
-
--success-alpha-weak: var(--function-success-
|
|
592
|
+
--success-alpha-strong: color-mix(in srgb, var(--function-success-500) 50%, transparent);
|
|
593
|
+
--success-alpha-medium: color-mix(in srgb, var(--function-success-500) 30%, transparent);
|
|
594
|
+
--success-alpha-weak: color-mix(in srgb, var(--function-success-500) 15%, transparent);
|
|
583
595
|
|
|
584
596
|
.dark-flex {
|
|
585
597
|
display: none;
|
|
@@ -598,12 +610,68 @@
|
|
|
598
610
|
}
|
|
599
611
|
}
|
|
600
612
|
|
|
613
|
+
/* showIn follows the nearest theme. On its own, [data-theme="light"]
|
|
614
|
+
.dark-flex hides a dark-only element inside a dark section of a light page
|
|
615
|
+
too; each ancestor theme deeper outweighs the one above, to three levels
|
|
616
|
+
(a light section on a dark page, then dark or invert inside it). */
|
|
617
|
+
[data-theme="light"] [data-theme="dark"],
|
|
618
|
+
[data-theme="dark"] [data-theme="light"] [data-theme="dark"] {
|
|
619
|
+
.dark-flex {
|
|
620
|
+
display: flex;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.dark-grid {
|
|
624
|
+
display: grid;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.light-flex,
|
|
628
|
+
.light-grid {
|
|
629
|
+
display: none;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
[data-theme="dark"] [data-theme="light"],
|
|
634
|
+
[data-theme="light"] [data-theme="dark"] [data-theme="light"] {
|
|
635
|
+
.light-flex {
|
|
636
|
+
display: flex;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
.light-grid {
|
|
640
|
+
display: grid;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.dark-flex,
|
|
644
|
+
.dark-grid {
|
|
645
|
+
display: none;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
|
|
601
649
|
[data-solid-style="plastic"] {
|
|
602
650
|
--solid-inset-distance: -1rem;
|
|
603
651
|
--solid-inset-size: 1rem;
|
|
604
652
|
--solid-border-width: 1px;
|
|
605
653
|
}
|
|
606
654
|
|
|
655
|
+
/* Glow: a solid lights its own colour into a soft halo, with a light edge
|
|
656
|
+
along the top. Static shadows only (no filter, no animation). The halo is
|
|
657
|
+
tighter and paler on light, where a wide one muddies the page. */
|
|
658
|
+
[data-solid-style="glow"] {
|
|
659
|
+
--solid-border-width: 1px;
|
|
660
|
+
--solid-glow-near: 0.625rem;
|
|
661
|
+
--solid-glow-far: 1.75rem;
|
|
662
|
+
--solid-glow-near-mix: 55%;
|
|
663
|
+
--solid-glow-far-mix: 22%;
|
|
664
|
+
--solid-glow-rim: var(--static-white-medium);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
[data-solid-style="glow"][data-theme="light"],
|
|
668
|
+
[data-solid-style="glow"] [data-theme="light"] {
|
|
669
|
+
--solid-glow-near: 0.5rem;
|
|
670
|
+
--solid-glow-far: 1.25rem;
|
|
671
|
+
--solid-glow-near-mix: 45%;
|
|
672
|
+
--solid-glow-far-mix: 14%;
|
|
673
|
+
}
|
|
674
|
+
|
|
607
675
|
[data-transition="all"],[data-transition="micro"] {
|
|
608
676
|
--transition-eased: ease-in-out;
|
|
609
677
|
--transition-property-all: all;
|
|
@@ -700,7 +768,9 @@
|
|
|
700
768
|
--brand-solid-weak: var(--function-brand-600);
|
|
701
769
|
|
|
702
770
|
--brand-on-solid-strong: var(--static-black);
|
|
703
|
-
|
|
771
|
+
/* The darkest brand step, as on-solid-weak's 200: 1100 is near-white
|
|
772
|
+
and read 1.9:1 on step 700. */
|
|
773
|
+
--brand-on-solid-medium: var(--function-brand-100);
|
|
704
774
|
--brand-on-solid-weak: var(--function-brand-200);
|
|
705
775
|
}
|
|
706
776
|
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Once UI for Tailwind CSS v4
|
|
3
|
+
*
|
|
4
|
+
* Import it before Tailwind, in the stylesheet where Tailwind is imported:
|
|
5
|
+
*
|
|
6
|
+
* @import "@once-ui-system/core/tailwind.css";
|
|
7
|
+
* @import "tailwindcss";
|
|
8
|
+
*
|
|
9
|
+
* What it does:
|
|
10
|
+
*
|
|
11
|
+
* 1. Layer order. Tailwind's preflight (`base`) sits under Once UI and
|
|
12
|
+
* Tailwind's utilities sit over it, so the reset never flattens a Once UI
|
|
13
|
+
* component and a `className="mt-4"` on one still wins. This file has to
|
|
14
|
+
* come before `@import "tailwindcss"`: a cascade layer keeps the place
|
|
15
|
+
* where its name first appears. Once UI's own stylesheets name the same
|
|
16
|
+
* order, so it holds whichever file the bundler loads first.
|
|
17
|
+
*
|
|
18
|
+
* 2. Once UI's tokens as Tailwind classes. They follow the theme, brand,
|
|
19
|
+
* accent and neutral colours you set in Once UI, light and dark included:
|
|
20
|
+
*
|
|
21
|
+
* bg-page bg-surface bg-{color}-{strength} bg-{color}-solid-{strength}
|
|
22
|
+
* bg-{color}-alpha-{strength}
|
|
23
|
+
* text-{color}-{strength} text-{color}-on-solid-{strength}
|
|
24
|
+
* border-{color}-{strength} border-surface
|
|
25
|
+
* ring-, outline-, fill-, stroke-, from-, to-, …: {color}-{strength}
|
|
26
|
+
* (the solid colour)
|
|
27
|
+
* rounded-xs … rounded-xl shadow-xs … shadow-xl
|
|
28
|
+
* font-heading font-body font-label font-code
|
|
29
|
+
* text-display-{size} text-heading-{size} text-body-{size}
|
|
30
|
+
* text-label-{size} (with Once UI's line heights)
|
|
31
|
+
*
|
|
32
|
+
* {color}: brand, accent, neutral, success, warning, danger, info
|
|
33
|
+
* {strength}: strong, medium, weak
|
|
34
|
+
* {size}: xs, s, m, l, xl
|
|
35
|
+
*
|
|
36
|
+
* 3. `dark:` and `light:` follow Once UI's `data-theme`, not the operating
|
|
37
|
+
* system, so they agree with the theme switcher.
|
|
38
|
+
*
|
|
39
|
+
* 4. No shared class names. Tailwind's utilities outrank Once UI's, so a
|
|
40
|
+
* class both define would take Tailwind's rule on Once UI's elements too.
|
|
41
|
+
* 3.0 spells Once UI's spacing out (`padding-16`, `margin-top-8`,
|
|
42
|
+
* `offset-top-16`, `grid-columns-2`), so `p-4` and `mt-8` stay Tailwind's.
|
|
43
|
+
* The names left in common mean the same in both (`flex-row`,
|
|
44
|
+
* `cursor-pointer`, `overflow-hidden`, …); the list below stops Tailwind
|
|
45
|
+
* generating them, so Once UI's breakpoint forms (`s-flex-column`) still
|
|
46
|
+
* win. In an app, `align-baseline` is Once UI's `align-items: baseline`,
|
|
47
|
+
* and `blur-xl` and `shadow-xl` are Once UI's sizes.
|
|
48
|
+
*
|
|
49
|
+
* Tailwind's own scales (spacing, red-500, rounded-lg, sm: breakpoints) are
|
|
50
|
+
* left as they are. Once UI already defines --radius-xs, --radius-xl,
|
|
51
|
+
* --shadow-xs and --shadow-xl, so rounded-xs, rounded-xl, shadow-xs and
|
|
52
|
+
* shadow-xl take Once UI's values.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
@layer properties, theme, base, once-ui, components, utilities;
|
|
56
|
+
|
|
57
|
+
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
|
|
58
|
+
@custom-variant light (&:where([data-theme="light"], [data-theme="light"] *));
|
|
59
|
+
|
|
60
|
+
/* tailwind-overlap:start
|
|
61
|
+
* Generated by scripts/tailwind-overlap.mjs: the class names Once UI and
|
|
62
|
+
* Tailwind both define. Tailwind does not generate them, so they keep Once
|
|
63
|
+
* UI's rule, which does the same thing, and its breakpoint forms still win.
|
|
64
|
+
*/
|
|
65
|
+
@source not inline("align-baseline backdrop-blur-xl backdrop-blur-xs blur-xl");
|
|
66
|
+
@source not inline("blur-xs border-1 border-2 border-4 border-6 border-8");
|
|
67
|
+
@source not inline("border-dashed border-solid border-x-1 border-y-1");
|
|
68
|
+
@source not inline("cursor-default cursor-grab cursor-grabbing cursor-help");
|
|
69
|
+
@source not inline("cursor-move cursor-not-allowed cursor-pointer cursor-text");
|
|
70
|
+
@source not inline("cursor-wait cursor-zoom-in cursor-zoom-out flex-0 flex-1");
|
|
71
|
+
@source not inline("flex-10 flex-11 flex-12 flex-2 flex-3 flex-4 flex-5");
|
|
72
|
+
@source not inline("flex-6 flex-7 flex-8 flex-9 flex-nowrap flex-row");
|
|
73
|
+
@source not inline("flex-row-reverse flex-wrap flex-wrap-reverse font-body");
|
|
74
|
+
@source not inline("font-code font-heading font-label font-medium font-normal");
|
|
75
|
+
@source not inline("justify-around justify-between justify-center justify-end");
|
|
76
|
+
@source not inline("justify-start justify-stretch list-decimal list-disc");
|
|
77
|
+
@source not inline("opacity-0 opacity-10 opacity-100 opacity-20 opacity-30");
|
|
78
|
+
@source not inline("opacity-40 opacity-50 opacity-60 opacity-70 opacity-80");
|
|
79
|
+
@source not inline("opacity-90 overflow-auto overflow-clip overflow-hidden");
|
|
80
|
+
@source not inline("overflow-scroll overflow-visible overflow-x-auto");
|
|
81
|
+
@source not inline("overflow-x-clip overflow-x-hidden overflow-x-scroll");
|
|
82
|
+
@source not inline("overflow-x-visible overflow-y-auto overflow-y-clip");
|
|
83
|
+
@source not inline("overflow-y-hidden overflow-y-scroll overflow-y-visible");
|
|
84
|
+
@source not inline("pointer-events-auto pointer-events-none shadow-l shadow-m");
|
|
85
|
+
@source not inline("shadow-s shadow-xl shadow-xs truncate");
|
|
86
|
+
/* tailwind-overlap:end */
|
|
87
|
+
|
|
88
|
+
/*
|
|
89
|
+
* Two preflight rules Once UI does not expect, set back to the browser's.
|
|
90
|
+
* `line-height: 1.5` on html would grow every element that inherits it (a
|
|
91
|
+
* table cell, a label), and `resize: vertical` would pin Textarea's handle.
|
|
92
|
+
* `:root` outranks preflight's bare selectors in the same layer, which comes
|
|
93
|
+
* after this file.
|
|
94
|
+
*/
|
|
95
|
+
@layer base {
|
|
96
|
+
:root {
|
|
97
|
+
line-height: normal;
|
|
98
|
+
}
|
|
99
|
+
:root textarea {
|
|
100
|
+
resize: revert-layer;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/*
|
|
105
|
+
* Every @theme block sits in `@layer theme`. Tailwind writes the theme
|
|
106
|
+
* variables its classes use (`rounded-xs` uses --radius-xs) where the first
|
|
107
|
+
* @theme block is; at the top level that was unlayered, so it beat Once UI's
|
|
108
|
+
* own --radius-xs and changed every Checkbox. In the theme layer, Once UI's
|
|
109
|
+
* tokens win.
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
/* Preflight's defaults for plain elements: Once UI's body and code fonts. */
|
|
113
|
+
@layer theme {
|
|
114
|
+
@theme inline {
|
|
115
|
+
--default-font-family: var(--font-body);
|
|
116
|
+
--default-mono-font-family: var(--font-code);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/*
|
|
121
|
+
* `reference`: Tailwind writes these values into the classes it generates
|
|
122
|
+
* and emits no variables of its own, so nothing shadows Once UI's tokens.
|
|
123
|
+
*/
|
|
124
|
+
@layer theme {
|
|
125
|
+
@theme inline reference {
|
|
126
|
+
/* bg-* */
|
|
127
|
+
--background-color-page: var(--page-background);
|
|
128
|
+
--background-color-surface: var(--surface-background);
|
|
129
|
+
--background-color-brand-strong: var(--brand-background-strong);
|
|
130
|
+
--background-color-brand-medium: var(--brand-background-medium);
|
|
131
|
+
--background-color-brand-weak: var(--brand-background-weak);
|
|
132
|
+
--background-color-brand-solid-strong: var(--brand-solid-strong);
|
|
133
|
+
--background-color-brand-solid-medium: var(--brand-solid-medium);
|
|
134
|
+
--background-color-brand-solid-weak: var(--brand-solid-weak);
|
|
135
|
+
--background-color-brand-alpha-strong: var(--brand-alpha-strong);
|
|
136
|
+
--background-color-brand-alpha-medium: var(--brand-alpha-medium);
|
|
137
|
+
--background-color-brand-alpha-weak: var(--brand-alpha-weak);
|
|
138
|
+
--background-color-accent-strong: var(--accent-background-strong);
|
|
139
|
+
--background-color-accent-medium: var(--accent-background-medium);
|
|
140
|
+
--background-color-accent-weak: var(--accent-background-weak);
|
|
141
|
+
--background-color-accent-solid-strong: var(--accent-solid-strong);
|
|
142
|
+
--background-color-accent-solid-medium: var(--accent-solid-medium);
|
|
143
|
+
--background-color-accent-solid-weak: var(--accent-solid-weak);
|
|
144
|
+
--background-color-accent-alpha-strong: var(--accent-alpha-strong);
|
|
145
|
+
--background-color-accent-alpha-medium: var(--accent-alpha-medium);
|
|
146
|
+
--background-color-accent-alpha-weak: var(--accent-alpha-weak);
|
|
147
|
+
--background-color-neutral-strong: var(--neutral-background-strong);
|
|
148
|
+
--background-color-neutral-medium: var(--neutral-background-medium);
|
|
149
|
+
--background-color-neutral-weak: var(--neutral-background-weak);
|
|
150
|
+
--background-color-neutral-solid-strong: var(--neutral-solid-strong);
|
|
151
|
+
--background-color-neutral-solid-medium: var(--neutral-solid-medium);
|
|
152
|
+
--background-color-neutral-solid-weak: var(--neutral-solid-weak);
|
|
153
|
+
--background-color-neutral-alpha-strong: var(--neutral-alpha-strong);
|
|
154
|
+
--background-color-neutral-alpha-medium: var(--neutral-alpha-medium);
|
|
155
|
+
--background-color-neutral-alpha-weak: var(--neutral-alpha-weak);
|
|
156
|
+
--background-color-success-strong: var(--success-background-strong);
|
|
157
|
+
--background-color-success-medium: var(--success-background-medium);
|
|
158
|
+
--background-color-success-weak: var(--success-background-weak);
|
|
159
|
+
--background-color-success-solid-strong: var(--success-solid-strong);
|
|
160
|
+
--background-color-success-solid-medium: var(--success-solid-medium);
|
|
161
|
+
--background-color-success-solid-weak: var(--success-solid-weak);
|
|
162
|
+
--background-color-success-alpha-strong: var(--success-alpha-strong);
|
|
163
|
+
--background-color-success-alpha-medium: var(--success-alpha-medium);
|
|
164
|
+
--background-color-success-alpha-weak: var(--success-alpha-weak);
|
|
165
|
+
--background-color-warning-strong: var(--warning-background-strong);
|
|
166
|
+
--background-color-warning-medium: var(--warning-background-medium);
|
|
167
|
+
--background-color-warning-weak: var(--warning-background-weak);
|
|
168
|
+
--background-color-warning-solid-strong: var(--warning-solid-strong);
|
|
169
|
+
--background-color-warning-solid-medium: var(--warning-solid-medium);
|
|
170
|
+
--background-color-warning-solid-weak: var(--warning-solid-weak);
|
|
171
|
+
--background-color-warning-alpha-strong: var(--warning-alpha-strong);
|
|
172
|
+
--background-color-warning-alpha-medium: var(--warning-alpha-medium);
|
|
173
|
+
--background-color-warning-alpha-weak: var(--warning-alpha-weak);
|
|
174
|
+
--background-color-danger-strong: var(--danger-background-strong);
|
|
175
|
+
--background-color-danger-medium: var(--danger-background-medium);
|
|
176
|
+
--background-color-danger-weak: var(--danger-background-weak);
|
|
177
|
+
--background-color-danger-solid-strong: var(--danger-solid-strong);
|
|
178
|
+
--background-color-danger-solid-medium: var(--danger-solid-medium);
|
|
179
|
+
--background-color-danger-solid-weak: var(--danger-solid-weak);
|
|
180
|
+
--background-color-danger-alpha-strong: var(--danger-alpha-strong);
|
|
181
|
+
--background-color-danger-alpha-medium: var(--danger-alpha-medium);
|
|
182
|
+
--background-color-danger-alpha-weak: var(--danger-alpha-weak);
|
|
183
|
+
--background-color-info-strong: var(--info-background-strong);
|
|
184
|
+
--background-color-info-medium: var(--info-background-medium);
|
|
185
|
+
--background-color-info-weak: var(--info-background-weak);
|
|
186
|
+
--background-color-info-solid-strong: var(--info-solid-strong);
|
|
187
|
+
--background-color-info-solid-medium: var(--info-solid-medium);
|
|
188
|
+
--background-color-info-solid-weak: var(--info-solid-weak);
|
|
189
|
+
--background-color-info-alpha-strong: var(--info-alpha-strong);
|
|
190
|
+
--background-color-info-alpha-medium: var(--info-alpha-medium);
|
|
191
|
+
--background-color-info-alpha-weak: var(--info-alpha-weak);
|
|
192
|
+
|
|
193
|
+
/* text-* */
|
|
194
|
+
--text-color-brand-strong: var(--brand-on-background-strong);
|
|
195
|
+
--text-color-brand-medium: var(--brand-on-background-medium);
|
|
196
|
+
--text-color-brand-weak: var(--brand-on-background-weak);
|
|
197
|
+
--text-color-brand-on-solid-strong: var(--brand-on-solid-strong);
|
|
198
|
+
--text-color-brand-on-solid-medium: var(--brand-on-solid-medium);
|
|
199
|
+
--text-color-brand-on-solid-weak: var(--brand-on-solid-weak);
|
|
200
|
+
--text-color-accent-strong: var(--accent-on-background-strong);
|
|
201
|
+
--text-color-accent-medium: var(--accent-on-background-medium);
|
|
202
|
+
--text-color-accent-weak: var(--accent-on-background-weak);
|
|
203
|
+
--text-color-accent-on-solid-strong: var(--accent-on-solid-strong);
|
|
204
|
+
--text-color-accent-on-solid-medium: var(--accent-on-solid-medium);
|
|
205
|
+
--text-color-accent-on-solid-weak: var(--accent-on-solid-weak);
|
|
206
|
+
--text-color-neutral-strong: var(--neutral-on-background-strong);
|
|
207
|
+
--text-color-neutral-medium: var(--neutral-on-background-medium);
|
|
208
|
+
--text-color-neutral-weak: var(--neutral-on-background-weak);
|
|
209
|
+
--text-color-neutral-on-solid-strong: var(--neutral-on-solid-strong);
|
|
210
|
+
--text-color-neutral-on-solid-medium: var(--neutral-on-solid-medium);
|
|
211
|
+
--text-color-neutral-on-solid-weak: var(--neutral-on-solid-weak);
|
|
212
|
+
--text-color-success-strong: var(--success-on-background-strong);
|
|
213
|
+
--text-color-success-medium: var(--success-on-background-medium);
|
|
214
|
+
--text-color-success-weak: var(--success-on-background-weak);
|
|
215
|
+
--text-color-success-on-solid-strong: var(--success-on-solid-strong);
|
|
216
|
+
--text-color-success-on-solid-medium: var(--success-on-solid-medium);
|
|
217
|
+
--text-color-success-on-solid-weak: var(--success-on-solid-weak);
|
|
218
|
+
--text-color-warning-strong: var(--warning-on-background-strong);
|
|
219
|
+
--text-color-warning-medium: var(--warning-on-background-medium);
|
|
220
|
+
--text-color-warning-weak: var(--warning-on-background-weak);
|
|
221
|
+
--text-color-warning-on-solid-strong: var(--warning-on-solid-strong);
|
|
222
|
+
--text-color-warning-on-solid-medium: var(--warning-on-solid-medium);
|
|
223
|
+
--text-color-warning-on-solid-weak: var(--warning-on-solid-weak);
|
|
224
|
+
--text-color-danger-strong: var(--danger-on-background-strong);
|
|
225
|
+
--text-color-danger-medium: var(--danger-on-background-medium);
|
|
226
|
+
--text-color-danger-weak: var(--danger-on-background-weak);
|
|
227
|
+
--text-color-danger-on-solid-strong: var(--danger-on-solid-strong);
|
|
228
|
+
--text-color-danger-on-solid-medium: var(--danger-on-solid-medium);
|
|
229
|
+
--text-color-danger-on-solid-weak: var(--danger-on-solid-weak);
|
|
230
|
+
--text-color-info-strong: var(--info-on-background-strong);
|
|
231
|
+
--text-color-info-medium: var(--info-on-background-medium);
|
|
232
|
+
--text-color-info-weak: var(--info-on-background-weak);
|
|
233
|
+
--text-color-info-on-solid-strong: var(--info-on-solid-strong);
|
|
234
|
+
--text-color-info-on-solid-medium: var(--info-on-solid-medium);
|
|
235
|
+
--text-color-info-on-solid-weak: var(--info-on-solid-weak);
|
|
236
|
+
|
|
237
|
+
/* border-* and divide-* */
|
|
238
|
+
--border-color-surface: var(--surface-border);
|
|
239
|
+
--border-color-brand-strong: var(--brand-border-strong);
|
|
240
|
+
--border-color-brand-medium: var(--brand-border-medium);
|
|
241
|
+
--border-color-brand-weak: var(--brand-border-weak);
|
|
242
|
+
--border-color-accent-strong: var(--accent-border-strong);
|
|
243
|
+
--border-color-accent-medium: var(--accent-border-medium);
|
|
244
|
+
--border-color-accent-weak: var(--accent-border-weak);
|
|
245
|
+
--border-color-neutral-strong: var(--neutral-border-strong);
|
|
246
|
+
--border-color-neutral-medium: var(--neutral-border-medium);
|
|
247
|
+
--border-color-neutral-weak: var(--neutral-border-weak);
|
|
248
|
+
--border-color-success-strong: var(--success-border-strong);
|
|
249
|
+
--border-color-success-medium: var(--success-border-medium);
|
|
250
|
+
--border-color-success-weak: var(--success-border-weak);
|
|
251
|
+
--border-color-warning-strong: var(--warning-border-strong);
|
|
252
|
+
--border-color-warning-medium: var(--warning-border-medium);
|
|
253
|
+
--border-color-warning-weak: var(--warning-border-weak);
|
|
254
|
+
--border-color-danger-strong: var(--danger-border-strong);
|
|
255
|
+
--border-color-danger-medium: var(--danger-border-medium);
|
|
256
|
+
--border-color-danger-weak: var(--danger-border-weak);
|
|
257
|
+
--border-color-info-strong: var(--info-border-strong);
|
|
258
|
+
--border-color-info-medium: var(--info-border-medium);
|
|
259
|
+
--border-color-info-weak: var(--info-border-weak);
|
|
260
|
+
|
|
261
|
+
/* Everything else that takes a colour: ring-, outline-, fill-, stroke-, from-, … */
|
|
262
|
+
--color-brand-strong: var(--brand-solid-strong);
|
|
263
|
+
--color-brand-medium: var(--brand-solid-medium);
|
|
264
|
+
--color-brand-weak: var(--brand-solid-weak);
|
|
265
|
+
--color-accent-strong: var(--accent-solid-strong);
|
|
266
|
+
--color-accent-medium: var(--accent-solid-medium);
|
|
267
|
+
--color-accent-weak: var(--accent-solid-weak);
|
|
268
|
+
--color-neutral-strong: var(--neutral-solid-strong);
|
|
269
|
+
--color-neutral-medium: var(--neutral-solid-medium);
|
|
270
|
+
--color-neutral-weak: var(--neutral-solid-weak);
|
|
271
|
+
--color-success-strong: var(--success-solid-strong);
|
|
272
|
+
--color-success-medium: var(--success-solid-medium);
|
|
273
|
+
--color-success-weak: var(--success-solid-weak);
|
|
274
|
+
--color-warning-strong: var(--warning-solid-strong);
|
|
275
|
+
--color-warning-medium: var(--warning-solid-medium);
|
|
276
|
+
--color-warning-weak: var(--warning-solid-weak);
|
|
277
|
+
--color-danger-strong: var(--danger-solid-strong);
|
|
278
|
+
--color-danger-medium: var(--danger-solid-medium);
|
|
279
|
+
--color-danger-weak: var(--danger-solid-weak);
|
|
280
|
+
--color-info-strong: var(--info-solid-strong);
|
|
281
|
+
--color-info-medium: var(--info-solid-medium);
|
|
282
|
+
--color-info-weak: var(--info-solid-weak);
|
|
283
|
+
|
|
284
|
+
/* rounded-* (xs and xl are Once UI's already) */
|
|
285
|
+
--radius-s: var(--radius-s);
|
|
286
|
+
--radius-m: var(--radius-m);
|
|
287
|
+
--radius-l: var(--radius-l);
|
|
288
|
+
|
|
289
|
+
/* shadow-* (xs and xl are Once UI's already) */
|
|
290
|
+
--shadow-s: var(--shadow-s);
|
|
291
|
+
--shadow-m: var(--shadow-m);
|
|
292
|
+
--shadow-l: var(--shadow-l);
|
|
293
|
+
|
|
294
|
+
/* font-* */
|
|
295
|
+
--font-heading: var(--font-heading);
|
|
296
|
+
--font-body: var(--font-body);
|
|
297
|
+
--font-label: var(--font-label);
|
|
298
|
+
--font-code: var(--font-code);
|
|
299
|
+
|
|
300
|
+
/* text-{type}-{size} */
|
|
301
|
+
--text-display-xs: var(--font-size-display-xs);
|
|
302
|
+
--text-display-xs--line-height: var(--line-height-display-xs);
|
|
303
|
+
--text-display-s: var(--font-size-display-s);
|
|
304
|
+
--text-display-s--line-height: var(--line-height-display-s);
|
|
305
|
+
--text-display-m: var(--font-size-display-m);
|
|
306
|
+
--text-display-m--line-height: var(--line-height-display-m);
|
|
307
|
+
--text-display-l: var(--font-size-display-l);
|
|
308
|
+
--text-display-l--line-height: var(--line-height-display-l);
|
|
309
|
+
--text-display-xl: var(--font-size-display-xl);
|
|
310
|
+
--text-display-xl--line-height: var(--line-height-display-xl);
|
|
311
|
+
--text-heading-xs: var(--font-size-heading-xs);
|
|
312
|
+
--text-heading-xs--line-height: var(--line-height-heading-xs);
|
|
313
|
+
--text-heading-s: var(--font-size-heading-s);
|
|
314
|
+
--text-heading-s--line-height: var(--line-height-heading-s);
|
|
315
|
+
--text-heading-m: var(--font-size-heading-m);
|
|
316
|
+
--text-heading-m--line-height: var(--line-height-heading-m);
|
|
317
|
+
--text-heading-l: var(--font-size-heading-l);
|
|
318
|
+
--text-heading-l--line-height: var(--line-height-heading-l);
|
|
319
|
+
--text-heading-xl: var(--font-size-heading-xl);
|
|
320
|
+
--text-heading-xl--line-height: var(--line-height-heading-xl);
|
|
321
|
+
--text-body-xs: var(--font-size-body-xs);
|
|
322
|
+
--text-body-xs--line-height: var(--line-height-body-xs);
|
|
323
|
+
--text-body-s: var(--font-size-body-s);
|
|
324
|
+
--text-body-s--line-height: var(--line-height-body-s);
|
|
325
|
+
--text-body-m: var(--font-size-body-m);
|
|
326
|
+
--text-body-m--line-height: var(--line-height-body-m);
|
|
327
|
+
--text-body-l: var(--font-size-body-l);
|
|
328
|
+
--text-body-l--line-height: var(--line-height-body-l);
|
|
329
|
+
--text-body-xl: var(--font-size-body-xl);
|
|
330
|
+
--text-body-xl--line-height: var(--line-height-body-xl);
|
|
331
|
+
--text-label-xs: var(--font-size-label-xs);
|
|
332
|
+
--text-label-xs--line-height: var(--line-height-label-xs);
|
|
333
|
+
--text-label-s: var(--font-size-label-s);
|
|
334
|
+
--text-label-s--line-height: var(--line-height-label-s);
|
|
335
|
+
--text-label-m: var(--font-size-label-m);
|
|
336
|
+
--text-label-m--line-height: var(--line-height-label-m);
|
|
337
|
+
--text-label-l: var(--font-size-label-l);
|
|
338
|
+
--text-label-l--line-height: var(--line-height-label-l);
|
|
339
|
+
--text-label-xl: var(--font-size-label-xl);
|
|
340
|
+
--text-label-xl--line-height: var(--line-height-label-xl);
|
|
341
|
+
}
|
|
342
|
+
}
|
package/tokens/README.md
CHANGED
|
@@ -35,7 +35,7 @@ To resolve a theme, take every layer whose `when` entries all equal your
|
|
|
35
35
|
settings (and whose `maxWidth`, if any, is at least your screen width), apply
|
|
36
36
|
them in order of how many conditions they have (`:root` counts as one), then
|
|
37
37
|
file order — the same order the CSS cascade uses — and follow `{name}`
|
|
38
|
-
references until you reach a value.
|
|
38
|
+
references until you reach a value (for `{name}/a`, scale the colour's alpha by `a`).
|
|
39
39
|
|
|
40
40
|
Values:
|
|
41
41
|
|
|
@@ -43,6 +43,7 @@ Values:
|
|
|
43
43
|
| --- | --- | --- |
|
|
44
44
|
| Colour | `"#2d69fa"`, `"#0000001f"` | sRGB hex, converted from the OKLCH source; 8 digits when translucent. |
|
|
45
45
|
| Reference | `"{function-brand-300}"` | Another token. |
|
|
46
|
+
| Translucent reference | `"{function-neutral-400}/0.15"` | Another colour token at that opacity (multiplied with its own alpha). From `color-mix(in srgb, var(--x) 15%, transparent)`. |
|
|
46
47
|
| Length | `"0.75rem"`, `"1px"` | rem follows the root font size: 16px, 15px on phones (`font-scaling-mobile`). |
|
|
47
48
|
| Number | `500`, `1.1` | Font weights, multipliers. |
|
|
48
49
|
| Shadow | `[{ "x": 0, "y": 1, "blur": 2, "spread": 0, "color": "#00000014" }]` | One entry per layer. |
|