@shift-css/core 0.6.0 → 0.7.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/README.md +4 -3
- package/dist/components/button.css +4 -2
- package/dist/components/card.css +35 -1
- package/dist/components/input.css +14 -2
- package/dist/components/menu.css +3 -1
- package/dist/components/modal.css +62 -17
- package/dist/components/select.css +169 -0
- package/dist/components/skip-link.css +8 -3
- package/dist/components/surface.css +9 -5
- package/dist/components/tooltip.css +14 -8
- package/dist/reset.css +1 -1
- package/dist/shift.css +658 -40
- package/dist/shift.css.map +1 -1
- package/dist/shift.min.css +1 -1
- package/dist/utils/functions.css +103 -0
- package/dist/utils/scroll.css +233 -0
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
A zero-runtime, OKLCH-native CSS framework with automatic theming.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@shift-css/core)
|
|
6
|
+
[](https://www.npmjs.com/package/@shift-css/core)
|
|
6
7
|
[](LICENSE)
|
|
7
8
|
|
|
8
9
|
## Installation
|
|
@@ -78,9 +79,9 @@ Import only what you need:
|
|
|
78
79
|
|
|
79
80
|
| File | Size |
|
|
80
81
|
| --------------- | ------ |
|
|
81
|
-
| `shift.css` | ~
|
|
82
|
-
| `shift.min.css` | ~
|
|
83
|
-
| Gzipped | ~
|
|
82
|
+
| `shift.css` | ~83 KB |
|
|
83
|
+
| `shift.min.css` | ~64 KB |
|
|
84
|
+
| Gzipped | ~12 KB |
|
|
84
85
|
|
|
85
86
|
## Browser Support
|
|
86
87
|
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
color: contrast-color(var(--_btn-bg));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
transition: background-color var(--s-duration-150) var(--s-ease-out),
|
|
27
|
+
transition: background-color var(--s-duration-150) var(--s-ease-out),
|
|
28
|
+
border-color var(--s-duration-150) var(--s-ease-out),
|
|
29
|
+
transform var(--s-duration-100) var(--s-ease-out);
|
|
28
30
|
cursor: pointer;
|
|
29
31
|
user-select: none;
|
|
30
32
|
|
|
@@ -144,7 +146,7 @@
|
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
[s-btn][s-loading] {
|
|
147
|
-
color:
|
|
149
|
+
color: #0000;
|
|
148
150
|
pointer-events: none;
|
|
149
151
|
position: relative;
|
|
150
152
|
|
package/dist/components/card.css
CHANGED
|
@@ -57,6 +57,12 @@
|
|
|
57
57
|
color: var(--s-text-secondary);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
[s-card-actions] {
|
|
61
|
+
gap: var(--s-space-2);
|
|
62
|
+
margin-top: var(--s-space-4);
|
|
63
|
+
display: flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
60
66
|
[s-card="flat"] {
|
|
61
67
|
--_card-shadow: none;
|
|
62
68
|
--_card-border: var(--s-border-default);
|
|
@@ -80,7 +86,9 @@
|
|
|
80
86
|
|
|
81
87
|
[s-card][s-interactive] {
|
|
82
88
|
cursor: pointer;
|
|
83
|
-
transition: transform var(--s-duration-200) var(--s-ease-out),
|
|
89
|
+
transition: transform var(--s-duration-200) var(--s-ease-out),
|
|
90
|
+
box-shadow var(--s-duration-200) var(--s-ease-out),
|
|
91
|
+
border-color var(--s-duration-200) var(--s-ease-out);
|
|
84
92
|
|
|
85
93
|
&:hover {
|
|
86
94
|
--_card-shadow: var(--s-shadow-xl);
|
|
@@ -183,3 +191,29 @@
|
|
|
183
191
|
}
|
|
184
192
|
}
|
|
185
193
|
}
|
|
194
|
+
|
|
195
|
+
@supports selector(:scope) {
|
|
196
|
+
@scope ([s-card]) to ([s-card]) {
|
|
197
|
+
[s-card-header] {
|
|
198
|
+
border-bottom: 1px solid var(--_card-border, var(--s-border-muted));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
[s-card-footer] {
|
|
202
|
+
border-top: 1px solid var(--_card-border, var(--s-border-muted));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
[s-card-title] {
|
|
206
|
+
color: inherit;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
[s-card-subtitle] {
|
|
210
|
+
color: var(--s-text-secondary);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
[s-card-actions] {
|
|
214
|
+
gap: var(--s-space-2);
|
|
215
|
+
margin-top: var(--s-space-4);
|
|
216
|
+
display: flex;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
color: var(--_input-text);
|
|
14
14
|
font-size: var(--s-text-sm);
|
|
15
15
|
line-height: var(--s-leading-normal);
|
|
16
|
-
transition: border-color var(--s-duration-150) var(--s-ease-out),
|
|
16
|
+
transition: border-color var(--s-duration-150) var(--s-ease-out),
|
|
17
|
+
box-shadow var(--s-duration-150) var(--s-ease-out);
|
|
17
18
|
display: block;
|
|
18
19
|
|
|
19
20
|
&::placeholder {
|
|
@@ -64,6 +65,16 @@ textarea[s-input] {
|
|
|
64
65
|
min-height: 6rem;
|
|
65
66
|
}
|
|
66
67
|
|
|
68
|
+
textarea[s-input][s-autosize] {
|
|
69
|
+
resize: none;
|
|
70
|
+
|
|
71
|
+
@supports (field-sizing: content) {
|
|
72
|
+
field-sizing: content;
|
|
73
|
+
min-height: 3lh;
|
|
74
|
+
max-height: 20lh;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
67
78
|
select[s-input] {
|
|
68
79
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
|
|
69
80
|
background-repeat: no-repeat;
|
|
@@ -145,7 +156,8 @@ select[s-input] {
|
|
|
145
156
|
cursor: pointer;
|
|
146
157
|
width: 1.25rem;
|
|
147
158
|
height: 1.25rem;
|
|
148
|
-
transition: background-color var(--s-duration-150) var(--s-ease-out),
|
|
159
|
+
transition: background-color var(--s-duration-150) var(--s-ease-out),
|
|
160
|
+
border-color var(--s-duration-150) var(--s-ease-out);
|
|
149
161
|
|
|
150
162
|
&:checked {
|
|
151
163
|
background-color: var(--s-interactive-primary);
|
package/dist/components/menu.css
CHANGED
|
@@ -45,7 +45,9 @@
|
|
|
45
45
|
color: var(--s-text-primary);
|
|
46
46
|
opacity: 0;
|
|
47
47
|
visibility: hidden;
|
|
48
|
-
transition: opacity var(--s-duration-150) var(--s-ease-out),
|
|
48
|
+
transition: opacity var(--s-duration-150) var(--s-ease-out),
|
|
49
|
+
transform var(--s-duration-150) var(--s-ease-out),
|
|
50
|
+
visibility var(--s-duration-150);
|
|
49
51
|
flex-direction: column;
|
|
50
52
|
display: flex;
|
|
51
53
|
position: absolute;
|
|
@@ -28,29 +28,50 @@ dialog[s-modal]:not([open]) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
dialog[s-modal][open] {
|
|
31
|
-
|
|
31
|
+
opacity: 1;
|
|
32
|
+
transition: opacity var(--s-duration-200) var(--s-ease-out),
|
|
33
|
+
transform var(--s-duration-200) var(--s-ease-out),
|
|
34
|
+
overlay var(--s-duration-200) var(--s-ease-out) allow-discrete,
|
|
35
|
+
display var(--s-duration-200) var(--s-ease-out) allow-discrete;
|
|
36
|
+
transform: scale(1)translateY(0);
|
|
32
37
|
}
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
outline-offset: 2px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@keyframes s-modal-scale-in {
|
|
40
|
-
from {
|
|
39
|
+
@starting-style {
|
|
40
|
+
dialog[s-modal][open] {
|
|
41
41
|
opacity: 0;
|
|
42
42
|
transform: scale(.95)translateY(-10px);
|
|
43
43
|
}
|
|
44
|
+
}
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
@supports not (transition-behavior: allow-discrete) {
|
|
47
|
+
dialog[s-modal][open] {
|
|
48
|
+
animation: s-modal-scale-in var(--s-duration-200) var(--s-ease-out);
|
|
48
49
|
}
|
|
50
|
+
|
|
51
|
+
@keyframes s-modal-scale-in {
|
|
52
|
+
from {
|
|
53
|
+
opacity: 0;
|
|
54
|
+
transform: scale(.95)translateY(-10px);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
to {
|
|
58
|
+
opacity: 1;
|
|
59
|
+
transform: scale(1)translateY(0);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
dialog[s-modal]:focus-visible {
|
|
65
|
+
outline: 2px solid var(--s-focus-ring);
|
|
66
|
+
outline-offset: 2px;
|
|
49
67
|
}
|
|
50
68
|
|
|
51
69
|
dialog[s-modal]::backdrop {
|
|
52
70
|
backdrop-filter: blur(4px);
|
|
53
|
-
|
|
71
|
+
opacity: 1;
|
|
72
|
+
transition: opacity var(--s-duration-200) var(--s-ease-out),
|
|
73
|
+
overlay var(--s-duration-200) var(--s-ease-out) allow-discrete,
|
|
74
|
+
display var(--s-duration-200) var(--s-ease-out) allow-discrete;
|
|
54
75
|
background: oklch(0% 0 0 / .5);
|
|
55
76
|
|
|
56
77
|
@supports (color: oklch(from red l c h)) {
|
|
@@ -58,13 +79,25 @@ dialog[s-modal]::backdrop {
|
|
|
58
79
|
}
|
|
59
80
|
}
|
|
60
81
|
|
|
61
|
-
@
|
|
62
|
-
|
|
82
|
+
@starting-style {
|
|
83
|
+
dialog[s-modal]::backdrop {
|
|
63
84
|
opacity: 0;
|
|
64
85
|
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@supports not (transition-behavior: allow-discrete) {
|
|
89
|
+
dialog[s-modal]::backdrop {
|
|
90
|
+
animation: s-modal-backdrop-in var(--s-duration-200) var(--s-ease-out);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@keyframes s-modal-backdrop-in {
|
|
94
|
+
from {
|
|
95
|
+
opacity: 0;
|
|
96
|
+
}
|
|
65
97
|
|
|
66
|
-
|
|
67
|
-
|
|
98
|
+
to {
|
|
99
|
+
opacity: 1;
|
|
100
|
+
}
|
|
68
101
|
}
|
|
69
102
|
}
|
|
70
103
|
|
|
@@ -160,7 +193,8 @@ dialog[s-modal][s-position="right"] {
|
|
|
160
193
|
min-height: 2.75rem;
|
|
161
194
|
font-size: var(--s-text-xl);
|
|
162
195
|
color: var(--s-text-secondary);
|
|
163
|
-
transition: background-color var(--s-duration-150) var(--s-ease-out),
|
|
196
|
+
transition: background-color var(--s-duration-150) var(--s-ease-out),
|
|
197
|
+
color var(--s-duration-150) var(--s-ease-out);
|
|
164
198
|
background: none;
|
|
165
199
|
border: none;
|
|
166
200
|
justify-content: center;
|
|
@@ -184,6 +218,17 @@ dialog[s-modal][s-position="right"] {
|
|
|
184
218
|
}
|
|
185
219
|
}
|
|
186
220
|
|
|
221
|
+
@media (prefers-reduced-motion: reduce) {
|
|
222
|
+
dialog[s-modal][open] {
|
|
223
|
+
transition: none;
|
|
224
|
+
transform: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
dialog[s-modal]::backdrop {
|
|
228
|
+
transition: none;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
187
232
|
@media (forced-colors: active) {
|
|
188
233
|
dialog[s-modal] {
|
|
189
234
|
border: 2px solid canvastext;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
@supports (appearance: base-select) {
|
|
2
|
+
[s-select], [s-select]::picker(select) {
|
|
3
|
+
appearance: base-select;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
:where([s-select]) {
|
|
7
|
+
--_select-bg: var(--s-surface-base);
|
|
8
|
+
--_select-border: var(--s-border-default);
|
|
9
|
+
--_select-text: var(--s-text-primary);
|
|
10
|
+
--_select-radius: var(--s-radius-md);
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: var(--s-space-2);
|
|
13
|
+
min-width: 10rem;
|
|
14
|
+
padding: var(--s-space-2) var(--s-space-3);
|
|
15
|
+
background-color: var(--_select-bg);
|
|
16
|
+
border: 2px solid var(--_select-border);
|
|
17
|
+
border-radius: var(--_select-radius);
|
|
18
|
+
color: var(--_select-text);
|
|
19
|
+
font-size: var(--s-text-sm);
|
|
20
|
+
line-height: var(--s-leading-normal);
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
transition: border-color var(--s-duration-150) var(--s-ease-out),
|
|
23
|
+
box-shadow var(--s-duration-150) var(--s-ease-out);
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
|
|
26
|
+
&:hover:not(:disabled) {
|
|
27
|
+
--_select-border: var(--s-border-strong);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:open {
|
|
31
|
+
--_select-border: var(--s-interactive-primary);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:focus-visible {
|
|
35
|
+
--_select-border: var(--s-interactive-primary);
|
|
36
|
+
outline: 2px solid var(--s-focus-ring);
|
|
37
|
+
outline-offset: 2px;
|
|
38
|
+
|
|
39
|
+
@supports (color: oklch(from red l c h)) {
|
|
40
|
+
outline-color: oklch(from var(--s-interactive-primary) l c h / .3);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:disabled {
|
|
45
|
+
opacity: .5;
|
|
46
|
+
cursor: not-allowed;
|
|
47
|
+
background-color: var(--s-surface-sunken);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[s-select]::picker-icon {
|
|
52
|
+
color: var(--s-text-tertiary);
|
|
53
|
+
transition: rotate var(--s-duration-200) var(--s-ease-out);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[s-select]:open::picker-icon {
|
|
57
|
+
rotate: 180deg;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[s-select]::picker(select) {
|
|
61
|
+
background: var(--s-surface-base);
|
|
62
|
+
border: 2px solid var(--s-border-default);
|
|
63
|
+
border-radius: var(--s-radius-md);
|
|
64
|
+
box-shadow: var(--s-shadow-lg);
|
|
65
|
+
padding: var(--s-space-1);
|
|
66
|
+
inset: auto;
|
|
67
|
+
top: anchor(bottom);
|
|
68
|
+
left: anchor(left);
|
|
69
|
+
min-width: anchor-size(width);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[s-select] option {
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: var(--s-space-2);
|
|
75
|
+
padding: var(--s-space-2) var(--s-space-3);
|
|
76
|
+
border-radius: var(--s-radius-sm);
|
|
77
|
+
color: var(--s-text-primary);
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
transition: background-color var(--s-duration-150) var(--s-ease-out);
|
|
80
|
+
display: flex;
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
background-color: var(--s-surface-hover);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:checked {
|
|
87
|
+
background-color: var(--s-interactive-primary);
|
|
88
|
+
color: var(--s-text-on-primary);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
[s-select] option::checkmark {
|
|
93
|
+
opacity: 0;
|
|
94
|
+
order: 1;
|
|
95
|
+
margin-left: auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[s-select] option:checked::checkmark {
|
|
99
|
+
opacity: 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
[s-select][s-size="sm"] {
|
|
103
|
+
padding: var(--s-space-1) var(--s-space-2);
|
|
104
|
+
font-size: var(--s-text-xs);
|
|
105
|
+
min-width: 8rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[s-select][s-size="lg"] {
|
|
109
|
+
padding: var(--s-space-3) var(--s-space-4);
|
|
110
|
+
font-size: var(--s-text-base);
|
|
111
|
+
min-width: 12rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@container surface style(--_surface-depth: 1) {
|
|
115
|
+
:where([s-select]) {
|
|
116
|
+
--_select-bg: var(--s-surface-sunken);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@container surface style(--_surface-depth: 2) {
|
|
121
|
+
:where([s-select]) {
|
|
122
|
+
--_select-bg: var(--s-surface-sunken);
|
|
123
|
+
--_select-border: var(--s-border-strong);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@container surface style(--_surface-depth: -1) {
|
|
128
|
+
:where([s-select]) {
|
|
129
|
+
--_select-bg: var(--s-surface-raised);
|
|
130
|
+
--_select-border: var(--s-border-muted);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@supports not (appearance: base-select) {
|
|
136
|
+
[s-select] {
|
|
137
|
+
appearance: none;
|
|
138
|
+
width: 100%;
|
|
139
|
+
padding: var(--s-space-2) var(--s-space-3);
|
|
140
|
+
padding-right: var(--s-space-10);
|
|
141
|
+
background-color: var(--s-surface-base);
|
|
142
|
+
border: 2px solid var(--s-border-default);
|
|
143
|
+
border-radius: var(--s-radius-md);
|
|
144
|
+
color: var(--s-text-primary);
|
|
145
|
+
font-size: var(--s-text-sm);
|
|
146
|
+
line-height: var(--s-leading-normal);
|
|
147
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
|
|
148
|
+
background-repeat: no-repeat;
|
|
149
|
+
background-position: right var(--s-space-3) center;
|
|
150
|
+
transition: border-color var(--s-duration-150) var(--s-ease-out),
|
|
151
|
+
box-shadow var(--s-duration-150) var(--s-ease-out);
|
|
152
|
+
display: block;
|
|
153
|
+
|
|
154
|
+
&:hover:not(:disabled) {
|
|
155
|
+
border-color: var(--s-border-strong);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:focus-visible {
|
|
159
|
+
border-color: var(--s-interactive-primary);
|
|
160
|
+
outline: 2px solid var(--s-focus-ring);
|
|
161
|
+
outline-offset: 2px;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&:disabled {
|
|
165
|
+
opacity: .5;
|
|
166
|
+
cursor: not-allowed;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
border-radius: var(--_skip-radius);
|
|
16
16
|
box-shadow: var(--_skip-shadow);
|
|
17
17
|
white-space: nowrap;
|
|
18
|
-
transition: top var(--s-duration-200) var(--s-ease-out),
|
|
18
|
+
transition: top var(--s-duration-200) var(--s-ease-out),
|
|
19
|
+
opacity var(--s-duration-200) var(--s-ease-out);
|
|
19
20
|
opacity: 0;
|
|
20
21
|
text-decoration: none;
|
|
21
22
|
display: inline-flex;
|
|
@@ -28,7 +29,9 @@
|
|
|
28
29
|
[s-skip-link]:focus, [s-skip-link]:focus-visible {
|
|
29
30
|
top: var(--s-space-4);
|
|
30
31
|
opacity: 1;
|
|
31
|
-
box-shadow: var(--_skip-shadow),
|
|
32
|
+
box-shadow: var(--_skip-shadow),
|
|
33
|
+
0 0 0 3px white,
|
|
34
|
+
0 0 0 5px var(--_skip-bg);
|
|
32
35
|
outline: none;
|
|
33
36
|
}
|
|
34
37
|
|
|
@@ -77,7 +80,9 @@
|
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
[s-skip-link]:focus, [s-skip-link]:focus-visible {
|
|
80
|
-
box-shadow: var(--_skip-shadow),
|
|
83
|
+
box-shadow: var(--_skip-shadow),
|
|
84
|
+
0 0 0 3px var(--s-neutral-900),
|
|
85
|
+
0 0 0 5px var(--_skip-bg);
|
|
81
86
|
}
|
|
82
87
|
}
|
|
83
88
|
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
container: surface / inline-size;
|
|
11
11
|
|
|
12
12
|
@supports (color: oklch(from red l c h)) {
|
|
13
|
-
color: oklch(from var(--_surface-bg)
|
|
13
|
+
color: oklch(from var(--_surface-bg)
|
|
14
|
+
/* If L < 0.55, use light text (0.95); otherwise dark text (0.15)
|
|
15
|
+
Threshold 0.55 ensures 4.5:1 contrast per WCAG 2.1 AA */
|
|
16
|
+
clamp(.15, calc((.55 - l) * 1000 + .15), .95) 0 0);
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
@supports (color: contrast-color(red)) {
|
|
@@ -47,7 +50,8 @@
|
|
|
47
50
|
|
|
48
51
|
[s-surface][s-interactive] {
|
|
49
52
|
cursor: pointer;
|
|
50
|
-
transition: transform var(--s-duration-150) var(--s-ease-out),
|
|
53
|
+
transition: transform var(--s-duration-150) var(--s-ease-out),
|
|
54
|
+
box-shadow var(--s-duration-150) var(--s-ease-out);
|
|
51
55
|
|
|
52
56
|
&:hover {
|
|
53
57
|
box-shadow: var(--s-shadow-lg);
|
|
@@ -91,7 +95,7 @@
|
|
|
91
95
|
background-color: #d4edda;
|
|
92
96
|
background-color: var(--_surface-bg);
|
|
93
97
|
border-left: 4px solid var(--s-state-success);
|
|
94
|
-
color: #1a1a1a;
|
|
98
|
+
color: light-dark(#1a1a1a, #e5e5e5);
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
[s-surface="warning"] {
|
|
@@ -99,7 +103,7 @@
|
|
|
99
103
|
background-color: #fff3cd;
|
|
100
104
|
background-color: var(--_surface-bg);
|
|
101
105
|
border-left: 4px solid var(--s-state-warning);
|
|
102
|
-
color: #1a1a1a;
|
|
106
|
+
color: light-dark(#1a1a1a, #e5e5e5);
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
[s-surface="danger"] {
|
|
@@ -107,7 +111,7 @@
|
|
|
107
111
|
background-color: #f8d7da;
|
|
108
112
|
background-color: var(--_surface-bg);
|
|
109
113
|
border-left: 4px solid var(--s-state-danger);
|
|
110
|
-
color: #1a1a1a;
|
|
114
|
+
color: light-dark(#1a1a1a, #e5e5e5);
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
@container (width <= 20rem) {
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
transform: translateX(-50%)translateY(4px);
|
|
28
28
|
|
|
29
29
|
@supports (color: oklch(from red l c h)) {
|
|
30
|
-
border: 1px solid
|
|
30
|
+
border: 1px solid
|
|
31
|
+
oklch(from var(--_tooltip-bg) max(calc(l - .1), .05) c h);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
font-size: var(--s-text-xs);
|
|
@@ -35,10 +36,13 @@
|
|
|
35
36
|
line-height: var(--s-leading-tight);
|
|
36
37
|
text-align: center;
|
|
37
38
|
text-wrap: balance;
|
|
38
|
-
min-width: min(100%,
|
|
39
|
+
min-width: min(100%,
|
|
40
|
+
var(--_tooltip-max-width));
|
|
39
41
|
max-width: var(--_tooltip-max-width);
|
|
40
42
|
pointer-events: none;
|
|
41
|
-
transition: opacity var(--s-duration-150) var(--s-ease-out),
|
|
43
|
+
transition: opacity var(--s-duration-150) var(--s-ease-out),
|
|
44
|
+
visibility var(--s-duration-150) var(--s-ease-out),
|
|
45
|
+
transform var(--s-duration-150) var(--s-ease-out);
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
:where([s-tooltip]):before {
|
|
@@ -46,12 +50,14 @@
|
|
|
46
50
|
visibility: hidden;
|
|
47
51
|
opacity: 0;
|
|
48
52
|
z-index: 9999;
|
|
49
|
-
margin-bottom: calc(var(--_tooltip-offset)
|
|
53
|
+
margin-bottom: calc(var(--_tooltip-offset) - var(--_tooltip-arrow-size));
|
|
50
54
|
border-left: var(--_tooltip-arrow-size) solid transparent;
|
|
51
55
|
border-right: var(--_tooltip-arrow-size) solid transparent;
|
|
52
56
|
border-top: var(--_tooltip-arrow-size) solid var(--_tooltip-bg);
|
|
53
57
|
pointer-events: none;
|
|
54
|
-
transition: opacity var(--s-duration-150) var(--s-ease-out),
|
|
58
|
+
transition: opacity var(--s-duration-150) var(--s-ease-out),
|
|
59
|
+
visibility var(--s-duration-150) var(--s-ease-out),
|
|
60
|
+
transform var(--s-duration-150) var(--s-ease-out);
|
|
55
61
|
position: absolute;
|
|
56
62
|
bottom: 100%;
|
|
57
63
|
left: 50%;
|
|
@@ -74,7 +80,7 @@
|
|
|
74
80
|
|
|
75
81
|
[s-tooltip-pos="bottom"]:before {
|
|
76
82
|
margin-bottom: 0;
|
|
77
|
-
margin-top: calc(var(--_tooltip-offset)
|
|
83
|
+
margin-top: calc(var(--_tooltip-offset) - var(--_tooltip-arrow-size));
|
|
78
84
|
border-top: none;
|
|
79
85
|
border-bottom: var(--_tooltip-arrow-size) solid var(--_tooltip-bg);
|
|
80
86
|
top: 100%;
|
|
@@ -95,7 +101,7 @@
|
|
|
95
101
|
|
|
96
102
|
[s-tooltip-pos="left"]:before {
|
|
97
103
|
margin-bottom: 0;
|
|
98
|
-
margin-right: calc(var(--_tooltip-offset)
|
|
104
|
+
margin-right: calc(var(--_tooltip-offset) - var(--_tooltip-arrow-size));
|
|
99
105
|
border-top: var(--_tooltip-arrow-size) solid transparent;
|
|
100
106
|
border-bottom: var(--_tooltip-arrow-size) solid transparent;
|
|
101
107
|
border-left: var(--_tooltip-arrow-size) solid var(--_tooltip-bg);
|
|
@@ -119,7 +125,7 @@
|
|
|
119
125
|
|
|
120
126
|
[s-tooltip-pos="right"]:before {
|
|
121
127
|
margin-bottom: 0;
|
|
122
|
-
margin-left: calc(var(--_tooltip-offset)
|
|
128
|
+
margin-left: calc(var(--_tooltip-offset) - var(--_tooltip-arrow-size));
|
|
123
129
|
border-top: var(--_tooltip-arrow-size) solid transparent;
|
|
124
130
|
border-bottom: var(--_tooltip-arrow-size) solid transparent;
|
|
125
131
|
border-right: var(--_tooltip-arrow-size) solid var(--_tooltip-bg);
|