@zambon-dev/ui 0.0.1-bootstrap.0 → 1.1.0
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/CHANGELOG.md +177 -0
- package/README.md +81 -81
- package/fesm2022/zambon-dev-ui-framework.mjs +5995 -3980
- package/fesm2022/zambon-dev-ui-framework.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-library.mjs +6003 -4272
- package/fesm2022/zambon-dev-ui-library.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-shared.mjs +2758 -1790
- package/fesm2022/zambon-dev-ui-shared.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-testing.mjs +73 -77
- package/fesm2022/zambon-dev-ui-testing.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui.mjs +6 -8
- package/i18n/framework/en.json +63 -63
- package/i18n/framework/pt.json +63 -63
- package/i18n/shared/external-content/en.json +12 -12
- package/i18n/shared/external-content/pt.json +12 -12
- package/i18n/shared/language-selector/en.json +5 -5
- package/i18n/shared/language-selector/pt.json +5 -5
- package/i18n/shared/login/en.json +16 -14
- package/i18n/shared/login/pt.json +16 -14
- package/i18n/shared/operations-history/en.json +5 -5
- package/i18n/shared/operations-history/pt.json +5 -5
- package/i18n/shared/services-history/en.json +14 -14
- package/i18n/shared/services-history/pt.json +14 -14
- package/i18n/shared/top-bar/en.json +10 -7
- package/i18n/shared/top-bar/pt.json +10 -7
- package/package.json +1 -1
- package/styles/common.scss +9 -10
- package/styles/components/card.scss +19 -13
- package/styles/components/dropdown-static.scss +33 -35
- package/styles/components/input-group.scss +48 -44
- package/styles/components/input.scss +120 -99
- package/styles/components/label.scss +6 -3
- package/styles/components/row.scss +48 -48
- package/styles/mixins/background.scss +31 -31
- package/styles/theme.css +307 -75
- package/styles/variables.scss +86 -60
- package/types/zambon-dev-ui-framework.d.ts +1470 -1029
- package/types/zambon-dev-ui-library.d.ts +1689 -1165
- package/types/zambon-dev-ui-shared.d.ts +630 -543
- package/types/zambon-dev-ui-testing.d.ts +25 -30
- package/types/zambon-dev-ui.d.ts +6 -3
- package/fesm2022/zambon-dev-ui.mjs.map +0 -1
- package/styles/components/button.scss +0 -101
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
.row {
|
|
2
|
-
@apply grid gap-3;
|
|
3
|
-
|
|
4
|
-
&.cols-1 {
|
|
5
|
-
@apply grid-cols-1;
|
|
6
|
-
}
|
|
7
|
-
&.cols-2 {
|
|
8
|
-
@apply grid-cols-2;
|
|
9
|
-
}
|
|
10
|
-
&.cols-3 {
|
|
11
|
-
@apply grid-cols-3;
|
|
12
|
-
}
|
|
13
|
-
&.cols-4 {
|
|
14
|
-
@apply grid-cols-4;
|
|
15
|
-
}
|
|
16
|
-
&.cols-5 {
|
|
17
|
-
@apply grid-cols-5;
|
|
18
|
-
}
|
|
19
|
-
&.cols-6 {
|
|
20
|
-
@apply grid-cols-6;
|
|
21
|
-
}
|
|
22
|
-
&.cols-7 {
|
|
23
|
-
@apply grid-cols-7;
|
|
24
|
-
}
|
|
25
|
-
&.cols-8 {
|
|
26
|
-
@apply grid-cols-8;
|
|
27
|
-
}
|
|
28
|
-
&.cols-9 {
|
|
29
|
-
@apply grid-cols-9;
|
|
30
|
-
}
|
|
31
|
-
&.cols-10 {
|
|
32
|
-
@apply grid-cols-10;
|
|
33
|
-
}
|
|
34
|
-
&.cols-11 {
|
|
35
|
-
@apply grid-cols-11;
|
|
36
|
-
}
|
|
37
|
-
&.cols-12 {
|
|
38
|
-
@apply grid-cols-12;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.input-group ~ .input-group {
|
|
42
|
-
@apply mt-0;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
~ .row {
|
|
46
|
-
@apply mt-3;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
.row {
|
|
2
|
+
@apply grid gap-3;
|
|
3
|
+
|
|
4
|
+
&.cols-1 {
|
|
5
|
+
@apply grid-cols-1;
|
|
6
|
+
}
|
|
7
|
+
&.cols-2 {
|
|
8
|
+
@apply grid-cols-2;
|
|
9
|
+
}
|
|
10
|
+
&.cols-3 {
|
|
11
|
+
@apply grid-cols-3;
|
|
12
|
+
}
|
|
13
|
+
&.cols-4 {
|
|
14
|
+
@apply grid-cols-4;
|
|
15
|
+
}
|
|
16
|
+
&.cols-5 {
|
|
17
|
+
@apply grid-cols-5;
|
|
18
|
+
}
|
|
19
|
+
&.cols-6 {
|
|
20
|
+
@apply grid-cols-6;
|
|
21
|
+
}
|
|
22
|
+
&.cols-7 {
|
|
23
|
+
@apply grid-cols-7;
|
|
24
|
+
}
|
|
25
|
+
&.cols-8 {
|
|
26
|
+
@apply grid-cols-8;
|
|
27
|
+
}
|
|
28
|
+
&.cols-9 {
|
|
29
|
+
@apply grid-cols-9;
|
|
30
|
+
}
|
|
31
|
+
&.cols-10 {
|
|
32
|
+
@apply grid-cols-10;
|
|
33
|
+
}
|
|
34
|
+
&.cols-11 {
|
|
35
|
+
@apply grid-cols-11;
|
|
36
|
+
}
|
|
37
|
+
&.cols-12 {
|
|
38
|
+
@apply grid-cols-12;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.input-group ~ .input-group {
|
|
42
|
+
@apply mt-0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
~ .row {
|
|
46
|
+
@apply mt-3;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
@mixin fixed-background($image, $color) {
|
|
2
|
-
@apply fixed -z-50 w-full h-screen;
|
|
3
|
-
|
|
4
|
-
@include background($image, $color);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
@mixin background($image, $color) {
|
|
8
|
-
@apply overflow-hidden;
|
|
9
|
-
|
|
10
|
-
&,
|
|
11
|
-
&:before {
|
|
12
|
-
@apply bg-[url(#{$image})] bg-fixed bg-cover;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&:before,
|
|
16
|
-
&:after {
|
|
17
|
-
@apply content-[''] absolute inset-0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&:before {
|
|
21
|
-
@apply blur-sm;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&:after {
|
|
25
|
-
@apply #{$color};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
* {
|
|
29
|
-
@apply z-10;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
@mixin fixed-background($image, $color) {
|
|
2
|
+
@apply fixed -z-50 w-full h-screen;
|
|
3
|
+
|
|
4
|
+
@include background($image, $color);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@mixin background($image, $color) {
|
|
8
|
+
@apply overflow-hidden;
|
|
9
|
+
|
|
10
|
+
&,
|
|
11
|
+
&:before {
|
|
12
|
+
@apply bg-[url(#{$image})] bg-fixed bg-cover;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&:before,
|
|
16
|
+
&:after {
|
|
17
|
+
@apply content-[''] absolute inset-0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:before {
|
|
21
|
+
@apply blur-sm;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:after {
|
|
25
|
+
@apply #{$color};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
* {
|
|
29
|
+
@apply z-10;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/styles/theme.css
CHANGED
|
@@ -1,75 +1,307 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* The Tailwind entry point and the design tokens built on top of it.
|
|
3
|
-
*
|
|
4
|
-
* Tailwind 4 has no JavaScript config: the theme is CSS custom properties declared in `@theme`,
|
|
5
|
-
* and every one of them doubles as a utility. `--color-primary-600` both defines the token and
|
|
6
|
-
* creates `bg-primary-600`, `text-primary-600` and the rest, which is why the palette that used to
|
|
7
|
-
* live in `tailwind.config.js` lives here now.
|
|
8
|
-
*
|
|
9
|
-
* Two kinds of file consume this:
|
|
10
|
-
*
|
|
11
|
-
* An application's global stylesheet imports it, and gets the framework plus the theme:
|
|
12
|
-
* @import '@zambon-dev/shared/styles/theme.css';
|
|
13
|
-
*
|
|
14
|
-
* A stylesheet that only uses `@apply` references it, and gets the theme without emitting the
|
|
15
|
-
* framework a second time:
|
|
16
|
-
* @reference '@zambon-dev/shared/styles/theme.css';
|
|
17
|
-
*
|
|
18
|
-
* That split is new in 4. In 3 the PostCSS plugin carried the config to every file it processed,
|
|
19
|
-
* so `@apply` worked anywhere; in 4 a file is on its own unless it says where its theme comes from.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/*
|
|
23
|
-
* `theme(static)` emits every theme variable, not only the ones this file is seen to use.
|
|
24
|
-
* Tailwind 4 prunes unused ones, and the design tokens in variables.scss reference the palette
|
|
25
|
-
* through `var(--color-gray-100)` from a different file -- which the pruner cannot see. Without
|
|
26
|
-
* this, those variables resolve to nothing: the sidebar text lost its colour and --app-backdrop's
|
|
27
|
-
* gradient became invalid and disappeared.
|
|
28
|
-
*/
|
|
29
|
-
@import 'tailwindcss' theme(static);
|
|
30
|
-
|
|
31
|
-
@plugin '@tailwindcss/forms';
|
|
32
|
-
|
|
33
|
-
/*
|
|
34
|
-
* Tailwind
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
@
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
--color-primary-
|
|
73
|
-
--color-primary-
|
|
74
|
-
--color-primary-
|
|
75
|
-
|
|
1
|
+
/*
|
|
2
|
+
* The Tailwind entry point and the design tokens built on top of it.
|
|
3
|
+
*
|
|
4
|
+
* Tailwind 4 has no JavaScript config: the theme is CSS custom properties declared in `@theme`,
|
|
5
|
+
* and every one of them doubles as a utility. `--color-primary-600` both defines the token and
|
|
6
|
+
* creates `bg-primary-600`, `text-primary-600` and the rest, which is why the palette that used to
|
|
7
|
+
* live in `tailwind.config.js` lives here now.
|
|
8
|
+
*
|
|
9
|
+
* Two kinds of file consume this:
|
|
10
|
+
*
|
|
11
|
+
* An application's global stylesheet imports it, and gets the framework plus the theme:
|
|
12
|
+
* @import '@zambon-dev/shared/styles/theme.css';
|
|
13
|
+
*
|
|
14
|
+
* A stylesheet that only uses `@apply` references it, and gets the theme without emitting the
|
|
15
|
+
* framework a second time:
|
|
16
|
+
* @reference '@zambon-dev/shared/styles/theme.css';
|
|
17
|
+
*
|
|
18
|
+
* That split is new in 4. In 3 the PostCSS plugin carried the config to every file it processed,
|
|
19
|
+
* so `@apply` worked anywhere; in 4 a file is on its own unless it says where its theme comes from.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/*
|
|
23
|
+
* `theme(static)` emits every theme variable, not only the ones this file is seen to use.
|
|
24
|
+
* Tailwind 4 prunes unused ones, and the design tokens in variables.scss reference the palette
|
|
25
|
+
* through `var(--color-gray-100)` from a different file -- which the pruner cannot see. Without
|
|
26
|
+
* this, those variables resolve to nothing: the sidebar text lost its colour and --app-backdrop's
|
|
27
|
+
* gradient became invalid and disappeared.
|
|
28
|
+
*/
|
|
29
|
+
@import 'tailwindcss' theme(static);
|
|
30
|
+
|
|
31
|
+
@plugin '@tailwindcss/forms';
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* Tailwind's `dark:` has to follow the same switch the tokens do. Left as the default it keys off
|
|
35
|
+
* the operating system, so the one `dark:bg-gray-700` in this repo already fires on a dark OS while
|
|
36
|
+
* nothing else does -- a skeleton that goes dark inside an otherwise light screen.
|
|
37
|
+
*/
|
|
38
|
+
@custom-variant dark (&:where([data-theme='dark'], [data-theme='dark'] *));
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
* Tailwind 4 changed the default border colour from `gray-200` to `currentColor`, so every element
|
|
42
|
+
* with a border and no colour of its own inherits the text colour. Across the Storybooks that was
|
|
43
|
+
* 615 elements going from a light grey hairline to solid black -- a change nothing in the build
|
|
44
|
+
* reports, which is the case tools/style-snapshot exists to catch.
|
|
45
|
+
*
|
|
46
|
+
* This restores the 3.x default. Removing it is a deliberate visual decision, not a cleanup: it
|
|
47
|
+
* means auditing every bordered element for one that was relying on the old default.
|
|
48
|
+
*/
|
|
49
|
+
@layer base {
|
|
50
|
+
*,
|
|
51
|
+
::after,
|
|
52
|
+
::before,
|
|
53
|
+
::backdrop,
|
|
54
|
+
::file-selector-button {
|
|
55
|
+
border-color: var(--color-gray-200, currentColor);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
* Tailwind 4 dropped the preflight rule that gave buttons a pointer cursor; the base reset now
|
|
61
|
+
* leaves them on the browser default. Restored, because every button in these libraries relied on
|
|
62
|
+
* it -- 41 elements across the Storybooks lost their pointer.
|
|
63
|
+
*/
|
|
64
|
+
@layer base {
|
|
65
|
+
button:not(:disabled),
|
|
66
|
+
[role='button']:not(:disabled) {
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@theme {
|
|
72
|
+
--color-primary-50: #e6f4ff;
|
|
73
|
+
--color-primary-100: #9acaed;
|
|
74
|
+
--color-primary-200: #59a5db;
|
|
75
|
+
--color-primary-300: #2585c8;
|
|
76
|
+
--color-primary-400: #006bb6;
|
|
77
|
+
--color-primary-500: #005794;
|
|
78
|
+
--color-primary-600: #004372;
|
|
79
|
+
--color-primary-700: #002f50;
|
|
80
|
+
--color-primary-800: #001b2f;
|
|
81
|
+
--color-primary-900: #00070d;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
* ---------------------------------------------------------------------------------------------
|
|
86
|
+
* The semantic core.
|
|
87
|
+
*
|
|
88
|
+
* Everything above this line is Tailwind's own theme: `--color-primary-*` is the raw brand ramp.
|
|
89
|
+
* Everything below names a *job* rather than a value -- a surface, a piece of content, a line, a
|
|
90
|
+
* state -- so that a component asks for the role it needs and a theme decides what that looks
|
|
91
|
+
* like. The component tokens that already shipped (`--sidebar-*`, `--tabs-*`) stay exactly where
|
|
92
|
+
* they are and derive from these; they are the published contract, this is the implementation.
|
|
93
|
+
*
|
|
94
|
+
* Every value here is the one those components already compute today. The core was read out of
|
|
95
|
+
* them, not invented, which is why adopting it changes no pixel.
|
|
96
|
+
*
|
|
97
|
+
* `static` is load-bearing, and not for the reason the `theme(static)` on the import above is.
|
|
98
|
+
* That option covers the theme Tailwind itself imports; a second `@theme` block is pruned on its
|
|
99
|
+
* own terms, and these tokens are referenced from other files, which the pruner cannot see. Built
|
|
100
|
+
* without it, every one of them is dropped and the dark block below is the only thing left --
|
|
101
|
+
* so the light theme resolves to nothing while the dark theme works. Nothing reports this.
|
|
102
|
+
* ---------------------------------------------------------------------------------------------
|
|
103
|
+
*/
|
|
104
|
+
@theme static {
|
|
105
|
+
/*
|
|
106
|
+
* Surfaces name the plane, not the colour. The language is "translucent cards floating over the
|
|
107
|
+
* backdrop", and what separates one level from the next is how much of the backdrop it lets
|
|
108
|
+
* through. The 45/70/88 ladder is the same one the tabs use for rest/hover/active -- not a
|
|
109
|
+
* coincidence, and the reason it lives here: hovering a tab is literally climbing one surface.
|
|
110
|
+
*/
|
|
111
|
+
--color-surface-brand: color-mix(in srgb, var(--color-primary-600) 82%, transparent);
|
|
112
|
+
--color-surface-glass-weak: color-mix(in srgb, white 45%, transparent);
|
|
113
|
+
--color-surface-glass: color-mix(in srgb, white 70%, transparent);
|
|
114
|
+
--color-surface-glass-strong: color-mix(in srgb, white 88%, transparent);
|
|
115
|
+
--color-surface-solid: var(--color-white);
|
|
116
|
+
--color-surface-inset: color-mix(in srgb, var(--color-gray-200) 40%, transparent);
|
|
117
|
+
--color-surface-scrim: color-mix(in srgb, black 50%, transparent);
|
|
118
|
+
|
|
119
|
+
/*
|
|
120
|
+
* "Content" and not "text": half the consumers are icons, `::before` glyphs and spinners.
|
|
121
|
+
* There is no `-disabled` here because disabled is an opacity on the element everywhere in
|
|
122
|
+
* this repo, never a colour -- see --opacity-disabled.
|
|
123
|
+
*/
|
|
124
|
+
--color-content-primary: var(--color-gray-900);
|
|
125
|
+
--color-content-secondary: var(--color-gray-600);
|
|
126
|
+
--color-content-subtle: var(--color-gray-400);
|
|
127
|
+
--color-content-on-brand: var(--color-gray-100);
|
|
128
|
+
--color-content-on-brand-muted: color-mix(in srgb, var(--color-gray-100) 60%, transparent);
|
|
129
|
+
--color-content-on-accent: var(--color-white);
|
|
130
|
+
|
|
131
|
+
/* "Line" covers border, divider and rule in one word; half of these are 1px pseudo-elements. */
|
|
132
|
+
--color-line: var(--color-gray-200);
|
|
133
|
+
--color-line-strong: color-mix(in srgb, var(--color-gray-400) 90%, transparent);
|
|
134
|
+
--color-line-on-glass: color-mix(in srgb, white 60%, transparent);
|
|
135
|
+
--color-line-on-brand: color-mix(in srgb, white 80%, var(--color-primary-600));
|
|
136
|
+
|
|
137
|
+
/*
|
|
138
|
+
* "Accent" rather than "primary": `--color-primary-*` is already the raw ramp, so this names the
|
|
139
|
+
* rung we chose. Retuning the brand becomes an edit here instead of a find-and-replace by rung.
|
|
140
|
+
*/
|
|
141
|
+
--color-accent: var(--color-primary-600);
|
|
142
|
+
--color-accent-strong: var(--color-primary-700);
|
|
143
|
+
--color-accent-weak: var(--color-primary-50);
|
|
144
|
+
|
|
145
|
+
/* Focus is its own family because it is the one state that has to survive every theme and every
|
|
146
|
+
surface, and because this repo currently has two generations of it to collapse. */
|
|
147
|
+
--color-focus-ring: var(--color-primary-400);
|
|
148
|
+
|
|
149
|
+
/* Two per role, because each appears exactly two ways: as ink (a validation message, a badge)
|
|
150
|
+
and as a 75% fill (the ribbon button's status). A third variant is a color-mix at the point
|
|
151
|
+
of use. */
|
|
152
|
+
--color-danger: var(--color-red-600);
|
|
153
|
+
--color-danger-surface: color-mix(in srgb, var(--color-red-600) 75%, transparent);
|
|
154
|
+
--color-warning: var(--color-yellow-600);
|
|
155
|
+
--color-warning-surface: color-mix(in srgb, var(--color-yellow-600) 75%, transparent);
|
|
156
|
+
--color-success: var(--color-green-600);
|
|
157
|
+
--color-success-surface: color-mix(in srgb, var(--color-green-600) 75%, transparent);
|
|
158
|
+
--color-info: var(--color-primary-400);
|
|
159
|
+
--color-info-surface: color-mix(in srgb, var(--color-primary-400) 75%, transparent);
|
|
160
|
+
|
|
161
|
+
/*
|
|
162
|
+
* Shapes, not a t-shirt scale: `sm/md/lg` invites copying a size instead of asking what kind of
|
|
163
|
+
* thing this is. --radius-nested keeps a child's corners parallel to its parent's, which is only
|
|
164
|
+
* true when the inner radius is the outer radius minus the gap between them.
|
|
165
|
+
*/
|
|
166
|
+
--radius-surface: 1.25rem;
|
|
167
|
+
--radius-control: 10px;
|
|
168
|
+
--radius-field: 0.375rem;
|
|
169
|
+
--radius-nested: calc(var(--radius-surface) - 0.5rem - 1px);
|
|
170
|
+
|
|
171
|
+
/* --shadow-overlay is the two-layer pair currently written out by hand in four files. */
|
|
172
|
+
--shadow-float: 0 10px 40px -12px rgb(0 0 0 / 0.25);
|
|
173
|
+
--shadow-float-strong: 0 10px 40px -12px rgb(0 0 0 / 0.45);
|
|
174
|
+
--shadow-overlay: 0 0 4px 0 rgb(0 0 0 / 0.2), 0 3px 20px 0 rgb(0 0 0 / 0.19);
|
|
175
|
+
|
|
176
|
+
/* One value for glass is deliberate: two translucent surfaces only match when the blur beneath
|
|
177
|
+
them matches too. The popover blur exists because a menu shares its plane with nothing. */
|
|
178
|
+
--blur-glass: 16px;
|
|
179
|
+
--blur-popover: 12px;
|
|
180
|
+
|
|
181
|
+
--ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
|
|
182
|
+
--ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
|
|
183
|
+
|
|
184
|
+
/*
|
|
185
|
+
* Roles, not a scale. There is no typographic scale here to preserve -- there are five jobs, and
|
|
186
|
+
* naming them is what stops `text-sm` vs `text-base` from being chosen by feel. These are new
|
|
187
|
+
* names inside Tailwind's `--text-*` namespace; overriding `--text-sm` would move the whole
|
|
188
|
+
* scale. No name may exist in both `--color-*` and `--text-*`, or `text-<name>` turns ambiguous.
|
|
189
|
+
*/
|
|
190
|
+
--text-caption: 0.75rem;
|
|
191
|
+
--text-body: 0.875rem;
|
|
192
|
+
--text-ui: 1rem;
|
|
193
|
+
--text-title: 1.125rem;
|
|
194
|
+
--text-display: 1.5rem;
|
|
195
|
+
--font-weight-ui: 500;
|
|
196
|
+
--font-weight-emphasis: 600;
|
|
197
|
+
--font-weight-strong: 700;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/*
|
|
201
|
+
* The rest of the core. These have no Tailwind namespace to live in -- there is no `--state-*` or
|
|
202
|
+
* `--duration-*` in the framework -- so they are plain custom properties. A declaration in a bare
|
|
203
|
+
* `:root` is never pruned, so they need no help from theme(static).
|
|
204
|
+
*/
|
|
205
|
+
:root {
|
|
206
|
+
/* State is a wash, expressed as a mix rather than a colour, because the established pattern is a
|
|
207
|
+
ladder of opacity over whatever is underneath -- not a different colour per state. */
|
|
208
|
+
--state-hover: color-mix(in srgb, var(--color-gray-900) 6%, transparent);
|
|
209
|
+
--state-pressed: color-mix(in srgb, var(--color-gray-900) 10%, transparent);
|
|
210
|
+
--state-selected: color-mix(in srgb, var(--color-primary-200) 25%, transparent);
|
|
211
|
+
--state-hover-on-brand: color-mix(in srgb, white 12%, transparent);
|
|
212
|
+
--state-selected-on-brand: color-mix(in srgb, white 22%, transparent);
|
|
213
|
+
|
|
214
|
+
--opacity-disabled: 0.6;
|
|
215
|
+
|
|
216
|
+
--focus-ring-width: 2px;
|
|
217
|
+
--focus-ring-offset: 0px;
|
|
218
|
+
|
|
219
|
+
/* Named for how they feel, not what they measure: a `--duration-200` is a number with extra
|
|
220
|
+
steps. Routing every transition through these is what makes the reduced-motion block below a
|
|
221
|
+
single rule instead of an audit. */
|
|
222
|
+
--duration-instant: 120ms;
|
|
223
|
+
--duration-short: 200ms;
|
|
224
|
+
--duration-long: 600ms;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/*
|
|
228
|
+
* One rule turns off the 600ms margin/width/rotate transitions across the whole repo, because every
|
|
229
|
+
* transition reads a duration token. This is the return on naming them.
|
|
230
|
+
*/
|
|
231
|
+
@media (prefers-reduced-motion: reduce) {
|
|
232
|
+
:root {
|
|
233
|
+
--duration-instant: 1ms;
|
|
234
|
+
--duration-short: 1ms;
|
|
235
|
+
--duration-long: 1ms;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/*
|
|
240
|
+
* ---------------------------------------------------------------------------------------------
|
|
241
|
+
* The dark theme.
|
|
242
|
+
*
|
|
243
|
+
* An attribute on <html>, not `prefers-color-scheme`. A media query would take the choice away
|
|
244
|
+
* from both sides: a consuming application could not opt out of a dark theme, and a user could not
|
|
245
|
+
* choose light on a dark OS. "Follow the system" is still the behaviour we want, but it is read in
|
|
246
|
+
* TypeScript and written here as `dark` -- so this file holds one block instead of two that have
|
|
247
|
+
* to be kept identical. The CSS never sees "system".
|
|
248
|
+
*
|
|
249
|
+
* Unlayered, so it beats the `@layer theme` block Tailwind emits above without !important.
|
|
250
|
+
*
|
|
251
|
+
* It restates colour and shadow only -- radius, blur, motion and type do not move between themes,
|
|
252
|
+
* and that is verifiable rather than asserted. It touches *only* core tokens, never `--sidebar-*`
|
|
253
|
+
* or `--tabs-*`: an application that overrides one of those keeps its override in both themes
|
|
254
|
+
* without doing anything.
|
|
255
|
+
* ---------------------------------------------------------------------------------------------
|
|
256
|
+
*/
|
|
257
|
+
:root {
|
|
258
|
+
color-scheme: light;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
:root[data-theme='dark'] {
|
|
262
|
+
color-scheme: dark;
|
|
263
|
+
|
|
264
|
+
--app-backdrop: linear-gradient(160deg, var(--color-gray-900) 0%, var(--color-gray-800) 100%);
|
|
265
|
+
|
|
266
|
+
--color-surface-brand: color-mix(in srgb, var(--color-primary-800) 82%, transparent);
|
|
267
|
+
--color-surface-glass-weak: color-mix(in srgb, var(--color-gray-900) 45%, transparent);
|
|
268
|
+
--color-surface-glass: color-mix(in srgb, var(--color-gray-900) 70%, transparent);
|
|
269
|
+
--color-surface-glass-strong: color-mix(in srgb, var(--color-gray-900) 88%, transparent);
|
|
270
|
+
--color-surface-solid: var(--color-gray-900);
|
|
271
|
+
--color-surface-inset: color-mix(in srgb, var(--color-gray-700) 40%, transparent);
|
|
272
|
+
--color-surface-scrim: color-mix(in srgb, black 70%, transparent);
|
|
273
|
+
|
|
274
|
+
--color-content-primary: var(--color-gray-100);
|
|
275
|
+
--color-content-secondary: var(--color-gray-400);
|
|
276
|
+
--color-content-subtle: var(--color-gray-500);
|
|
277
|
+
/* The on-brand pair does not move: the brand surface is dark in both themes. */
|
|
278
|
+
|
|
279
|
+
--color-line: var(--color-gray-700);
|
|
280
|
+
--color-line-strong: var(--color-gray-600);
|
|
281
|
+
--color-line-on-glass: color-mix(in srgb, white 12%, transparent);
|
|
282
|
+
--color-line-on-brand: color-mix(in srgb, white 45%, var(--color-primary-800));
|
|
283
|
+
|
|
284
|
+
--color-accent: var(--color-primary-300);
|
|
285
|
+
--color-accent-strong: var(--color-primary-200);
|
|
286
|
+
--color-accent-weak: color-mix(in srgb, var(--color-primary-300) 18%, transparent);
|
|
287
|
+
--color-focus-ring: var(--color-primary-300);
|
|
288
|
+
|
|
289
|
+
/* The wash inverts from black to white; the on-brand rungs stay white in both themes. */
|
|
290
|
+
--state-hover: color-mix(in srgb, white 8%, transparent);
|
|
291
|
+
--state-pressed: color-mix(in srgb, white 14%, transparent);
|
|
292
|
+
--state-selected: color-mix(in srgb, var(--color-primary-300) 22%, transparent);
|
|
293
|
+
|
|
294
|
+
--color-danger: var(--color-red-400);
|
|
295
|
+
--color-danger-surface: color-mix(in srgb, var(--color-red-400) 75%, transparent);
|
|
296
|
+
--color-warning: var(--color-yellow-400);
|
|
297
|
+
--color-warning-surface: color-mix(in srgb, var(--color-yellow-400) 75%, transparent);
|
|
298
|
+
--color-success: var(--color-green-400);
|
|
299
|
+
--color-success-surface: color-mix(in srgb, var(--color-green-400) 75%, transparent);
|
|
300
|
+
--color-info: var(--color-primary-300);
|
|
301
|
+
--color-info-surface: color-mix(in srgb, var(--color-primary-300) 75%, transparent);
|
|
302
|
+
|
|
303
|
+
/* Shadows carry further on a dark backdrop before they read as depth. */
|
|
304
|
+
--shadow-float: 0 10px 40px -12px rgb(0 0 0 / 0.7);
|
|
305
|
+
--shadow-float-strong: 0 10px 40px -12px rgb(0 0 0 / 0.85);
|
|
306
|
+
--shadow-overlay: 0 0 4px 0 rgb(0 0 0 / 0.5), 0 3px 20px 0 rgb(0 0 0 / 0.6);
|
|
307
|
+
}
|