@plexui/styles 0.3.2 → 0.3.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.
|
@@ -97,10 +97,17 @@
|
|
|
97
97
|
.ActionButton:hover:where(:not(:root[data-input="touch"] *)) {
|
|
98
98
|
background: var(--color-background-primary-solid-hover) !important;
|
|
99
99
|
}
|
|
100
|
-
}
|
|
101
|
-
|
|
100
|
+
}/* A soft secondary Button: the kit's quiet companion of a solid action */.CancelButton {
|
|
101
|
+
background: var(--color-background-secondary-soft-alpha) !important;
|
|
102
|
+
color: var(--color-text-secondary-soft) !important;
|
|
102
103
|
font-weight: var(--font-weight-medium);
|
|
103
|
-
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media (hover: hover) and (pointer: fine) {
|
|
107
|
+
.CancelButton:hover:where(:not(:root[data-input="touch"] *)) {
|
|
108
|
+
background: var(--color-background-secondary-soft-alpha-hover) !important;
|
|
109
|
+
}
|
|
110
|
+
}/* The close face: 20 across at the toast's trailing end (below), its X in the text color and a
|
|
104
111
|
ring an outline Button draws, which shows on the dark surface too (Sonner's
|
|
105
112
|
dark ring takes --normal-border, transparent here). An invisible 4px rim
|
|
106
113
|
around its 18px inner box makes the target 26, past the 24 of WCAG 2.5.8.
|
|
@@ -135,6 +142,155 @@
|
|
|
135
142
|
}.Toaster[dir="rtl"] .Toast[data-styled="true"] > [data-close-button] {
|
|
136
143
|
right: auto !important;
|
|
137
144
|
left: 12px !important;
|
|
145
|
+
}/* =============================================
|
|
146
|
+
Desktop: one row, or the buttons under a description
|
|
147
|
+
============================================= *//* On a desktop a toast sets its message and its controls as one row of the kit (owner 13.11: «собрано по уродски»:
|
|
148
|
+
the buttons stood 8px from the text and 16 apart, and the close button was a ringed circle of another family). The
|
|
149
|
+
controls stand 16 after the message and 8 apart, a group set off from the text, all one small kit Button: 28px,
|
|
150
|
+
6px corners, a 14px medium label; the action solid, the cancel soft, the close button the same 28px button, plain
|
|
151
|
+
(ghost), last in the row. A description makes the message a block of its own: its buttons go under it at the end,
|
|
152
|
+
12 below, as Material's snackbar and Geist's toast set a longer message, and the close button stays on the title's
|
|
153
|
+
line. The row starts 16 before the message and ends 10 after the last control, whose own padding (or glyph) keeps
|
|
154
|
+
its ink as far from the edge; with nothing after the message it ends 16 after it too. */@media (min-width: 768px) and (pointer: fine) {
|
|
155
|
+
.Toast[data-styled="true"]:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
156
|
+
--toast-control-size: var(--control-size-sm);
|
|
157
|
+
--toast-icon-room: 0px;
|
|
158
|
+
--toast-close-room: 0px;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: 0 !important;
|
|
161
|
+
padding: 10px 10px 10px 16px !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.Toast[data-styled="true"]:has(> .Icon):not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
165
|
+
--toast-icon-room: 30px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.Toast[data-styled="true"]:has(> [data-close-button]):not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
169
|
+
--toast-close-room: calc(var(--toast-control-size) + 8px);
|
|
170
|
+
padding-inline-end: 10px !important;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.Toast[data-styled="true"]:not(:has(> .Content ~ *, > [data-close-button])):not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
174
|
+
padding-inline-end: 16px !important;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* The icon, the message, its buttons, then the close button (Sonner puts the close button first) */
|
|
178
|
+
.Toast[data-styled="true"] > .Icon:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
179
|
+
order: 1;
|
|
180
|
+
width: 20px !important;
|
|
181
|
+
height: 20px !important;
|
|
182
|
+
margin-inline: 0 10px !important;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.Toast[data-styled="true"] > .Content:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
186
|
+
order: 2;
|
|
187
|
+
flex: 1 1 auto;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
min-width: 0;
|
|
190
|
+
/* A line of text alone is as tall as a row of buttons */
|
|
191
|
+
min-height: var(--toast-control-size);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.Toast[data-styled="true"] > .Content ~ *:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
195
|
+
order: 3;
|
|
196
|
+
margin-inline: 8px 0 !important;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.Toast[data-styled="true"] > .Content + *:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
200
|
+
margin-inline-start: 16px !important;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.Toast[data-styled="true"] > :is(.ActionButton, .CancelButton):not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
204
|
+
height: var(--toast-control-size) !important;
|
|
205
|
+
padding: 0 var(--control-gutter-sm) !important;
|
|
206
|
+
border-radius: var(--control-radius-sm) !important;
|
|
207
|
+
font-size: var(--control-font-size-md) !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.Toast[data-styled="true"] > [data-close-button]:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
211
|
+
position: relative !important;
|
|
212
|
+
top: auto !important;
|
|
213
|
+
right: auto !important;
|
|
214
|
+
bottom: auto !important;
|
|
215
|
+
left: auto !important;
|
|
216
|
+
flex: none;
|
|
217
|
+
order: 4;
|
|
218
|
+
width: var(--toast-control-size) !important;
|
|
219
|
+
height: var(--toast-control-size) !important;
|
|
220
|
+
margin-inline-start: 16px;
|
|
221
|
+
border: 0 !important;
|
|
222
|
+
border-radius: var(--control-radius-sm) !important;
|
|
223
|
+
transform: none !important;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.Toast[data-styled="true"] > [data-close-button] > svg:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
227
|
+
width: 16px;
|
|
228
|
+
height: 16px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* The 28px button is the target */
|
|
232
|
+
.Toast[data-styled="true"] > [data-close-button]:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *))::after {
|
|
233
|
+
content: none;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* The right-to-left offset above would shift the button out of its place in the row */
|
|
237
|
+
.Toaster[dir="rtl"] .Toast[data-styled="true"] > [data-close-button]:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
238
|
+
left: auto !important;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.Toast[data-styled="true"]:has(> .Content ~ *) > [data-close-button]:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
242
|
+
margin-inline-start: 8px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.Toast[data-styled="true"]:not([data-rich-colors="true"]) > [data-close-button]:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
246
|
+
background: transparent !important;
|
|
247
|
+
color: var(--color-text-secondary-ghost) !important;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
@media (hover: hover) {
|
|
251
|
+
.Toast[data-styled="true"]:not([data-rich-colors="true"]) > [data-close-button]:hover:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
252
|
+
background: var(--color-background-secondary-ghost-hover) !important;
|
|
253
|
+
color: var(--color-text-secondary-ghost-hover) !important;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.Toast[data-styled="true"]:not([data-rich-colors="true"]) > [data-close-button]:active:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
258
|
+
background: var(--color-background-secondary-ghost-active) !important;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/* With a description: the icon, the message and the close button on the first row, the title's line their middle;
|
|
262
|
+
the buttons under the message at the end */
|
|
263
|
+
.Toast[data-styled="true"]:has(> .Content > .Description):not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
264
|
+
/* Sonner's unlayered stylesheet centres the row. Only here does the row wrap: a long title alone wraps in its
|
|
265
|
+
own column, beside its icon and its buttons */
|
|
266
|
+
flex-wrap: wrap;
|
|
267
|
+
align-items: flex-start !important;
|
|
268
|
+
row-gap: 12px !important;
|
|
269
|
+
padding-block: 14px 12px !important;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.Toast[data-styled="true"]:has(> .Content > .Description) > .Content:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
273
|
+
flex: 1 1 0;
|
|
274
|
+
min-width: calc(100% - var(--toast-icon-room) - var(--toast-close-room));
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.Toast[data-styled="true"]:has(> .Content > .Description) > [data-close-button]:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
278
|
+
order: 3;
|
|
279
|
+
margin-block-start: -4px;
|
|
280
|
+
margin-inline-start: 8px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.Toast[data-styled="true"]:has(> .Content > .Description) > .Content ~ *:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
284
|
+
order: 4;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.Toast[data-styled="true"]:has(> .Content > .Description) > .Content + *:not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
288
|
+
margin-inline-start: auto !important;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.Toast[data-styled="true"]:has(> .Content > .Description):not(:has(> .Content ~ *)):not(:where([data-plex-layout="phone"], [data-plex-layout="phone"] *)) {
|
|
292
|
+
padding-block-end: 14px !important;
|
|
293
|
+
}
|
|
138
294
|
}.Toast :is([data-button], [data-close-button]):disabled {
|
|
139
295
|
cursor: not-allowed;
|
|
140
296
|
opacity: 0.5;
|
|
@@ -232,14 +388,14 @@
|
|
|
232
388
|
transform: none !important;
|
|
233
389
|
}
|
|
234
390
|
|
|
391
|
+
/* The face is filled as the cancel button is, a soft secondary circle, as iOS draws a close button
|
|
392
|
+
(xmark in a filled circle), not a ring of another family (owner 13.11) */
|
|
235
393
|
.Toast[data-styled="true"] > [data-close-button]::before {
|
|
236
394
|
position: absolute;
|
|
237
395
|
z-index: -1;
|
|
238
396
|
inset: 12px;
|
|
239
|
-
box-sizing: border-box;
|
|
240
|
-
border: 1px solid var(--color-border-secondary-outline);
|
|
241
397
|
border-radius: 50%;
|
|
242
|
-
background: var(--
|
|
398
|
+
background: var(--color-background-secondary-soft-alpha);
|
|
243
399
|
content: "";
|
|
244
400
|
pointer-events: none;
|
|
245
401
|
}
|
|
@@ -251,7 +407,7 @@
|
|
|
251
407
|
|
|
252
408
|
/* Only the face answers a hover: the whole target stays clear */
|
|
253
409
|
.Toast[data-styled="true"] > [data-close-button]:hover::before {
|
|
254
|
-
|
|
410
|
+
background: var(--color-background-secondary-soft-alpha-hover);
|
|
255
411
|
}
|
|
256
412
|
|
|
257
413
|
.Toaster[dir="rtl"] .Toast[data-styled="true"] > [data-close-button] {
|
|
@@ -317,14 +473,14 @@
|
|
|
317
473
|
transform: none !important;
|
|
318
474
|
}
|
|
319
475
|
|
|
476
|
+
/* The face is filled as the cancel button is, a soft secondary circle, as iOS draws a close button
|
|
477
|
+
(xmark in a filled circle), not a ring of another family (owner 13.11) */
|
|
320
478
|
:where([data-plex-layout="phone"]) .Toast[data-styled="true"] > [data-close-button]::before {
|
|
321
479
|
position: absolute;
|
|
322
480
|
z-index: -1;
|
|
323
481
|
inset: 12px;
|
|
324
|
-
box-sizing: border-box;
|
|
325
|
-
border: 1px solid var(--color-border-secondary-outline);
|
|
326
482
|
border-radius: 50%;
|
|
327
|
-
background: var(--
|
|
483
|
+
background: var(--color-background-secondary-soft-alpha);
|
|
328
484
|
content: "";
|
|
329
485
|
pointer-events: none;
|
|
330
486
|
}
|
|
@@ -336,7 +492,7 @@
|
|
|
336
492
|
|
|
337
493
|
/* Only the face answers a hover: the whole target stays clear */
|
|
338
494
|
:where([data-plex-layout="phone"]) .Toast[data-styled="true"] > [data-close-button]:hover::before {
|
|
339
|
-
|
|
495
|
+
background: var(--color-background-secondary-soft-alpha-hover);
|
|
340
496
|
}
|
|
341
497
|
|
|
342
498
|
:where([data-plex-layout="phone"]) .Toaster[dir="rtl"] .Toast[data-styled="true"] > [data-close-button] {
|