stilo-editor 0.0.0-stage → 0.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.
Files changed (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +172 -2
  3. package/dist/characters--8h5uTeF.js +854 -0
  4. package/dist/content.css +161 -0
  5. package/dist/core/drop.d.ts +6 -0
  6. package/dist/core/editor.d.ts +108 -0
  7. package/dist/core/errors.d.ts +6 -0
  8. package/dist/core/events.d.ts +19 -0
  9. package/dist/core/extension-manager.d.ts +57 -0
  10. package/dist/core/extension.d.ts +43 -0
  11. package/dist/core/helpers/active.d.ts +33 -0
  12. package/dist/core/helpers/input-rules.d.ts +21 -0
  13. package/dist/core/helpers/lists.d.ts +12 -0
  14. package/dist/core/helpers/marks.d.ts +38 -0
  15. package/dist/core/helpers/nodes.d.ts +14 -0
  16. package/dist/core/helpers/parse-rules.d.ts +8 -0
  17. package/dist/core/html/css.d.ts +91 -0
  18. package/dist/core/html/parse.d.ts +7 -0
  19. package/dist/core/html/sanitize.d.ts +49 -0
  20. package/dist/core/html/serialize.d.ts +31 -0
  21. package/dist/core/types.d.ts +107 -0
  22. package/dist/extensions/blockquote/index.d.ts +15 -0
  23. package/dist/extensions/bold/index.d.ts +17 -0
  24. package/dist/extensions/bullet-list/index.d.ts +9 -0
  25. package/dist/extensions/clear-formatting/index.d.ts +12 -0
  26. package/dist/extensions/code/index.d.ts +15 -0
  27. package/dist/extensions/default-extensions/index.d.ts +46 -0
  28. package/dist/extensions/document/index.d.ts +17 -0
  29. package/dist/extensions/drop-cursor/index.d.ts +15 -0
  30. package/dist/extensions/gap-cursor/index.d.ts +6 -0
  31. package/dist/extensions/hard-break/index.d.ts +11 -0
  32. package/dist/extensions/heading/index.d.ts +24 -0
  33. package/dist/extensions/highlight/index.d.ts +24 -0
  34. package/dist/extensions/history/index.d.ts +21 -0
  35. package/dist/extensions/horizontal-rule/index.d.ts +11 -0
  36. package/dist/extensions/index.d.ts +27 -0
  37. package/dist/extensions/italic/index.d.ts +16 -0
  38. package/dist/extensions/link/index.d.ts +23 -0
  39. package/dist/extensions/list-item/index.d.ts +16 -0
  40. package/dist/extensions/move-block/index.d.ts +17 -0
  41. package/dist/extensions/ordered-list/index.d.ts +12 -0
  42. package/dist/extensions/paragraph/index.d.ts +14 -0
  43. package/dist/extensions/placeholder/index.d.ts +13 -0
  44. package/dist/extensions/strike/index.d.ts +16 -0
  45. package/dist/extensions/subscript/index.d.ts +16 -0
  46. package/dist/extensions/superscript/index.d.ts +17 -0
  47. package/dist/extensions/text/index.d.ts +12 -0
  48. package/dist/extensions/text-style/index.d.ts +14 -0
  49. package/dist/extensions/underline/index.d.ts +15 -0
  50. package/dist/index.d.ts +13 -0
  51. package/dist/index.js +1 -0
  52. package/dist/src-3tAxKI0c.js +1316 -0
  53. package/dist/style.css +797 -0
  54. package/dist/ui/components/character-picker.d.ts +22 -0
  55. package/dist/ui/components/characters.d.ts +10 -0
  56. package/dist/ui/components/color-button.d.ts +23 -0
  57. package/dist/ui/components/dropdown.d.ts +25 -0
  58. package/dist/ui/components/icon.d.ts +3 -0
  59. package/dist/ui/components/link-bubble.d.ts +19 -0
  60. package/dist/ui/components/link-popover.d.ts +20 -0
  61. package/dist/ui/components/popover.d.ts +27 -0
  62. package/dist/ui/components/shortcut.d.ts +11 -0
  63. package/dist/ui/i18n/en.d.ts +3 -0
  64. package/dist/ui/i18n/it.d.ts +3 -0
  65. package/dist/ui/i18n/types.d.ts +4 -0
  66. package/dist/ui/index.d.ts +19 -0
  67. package/dist/ui/toolbar/items.d.ts +12 -0
  68. package/dist/ui/toolbar/palette.d.ts +6 -0
  69. package/dist/ui/toolbar/toolbar.d.ts +28 -0
  70. package/dist/ui/toolbar/types.d.ts +87 -0
  71. package/dist/ui.css +635 -0
  72. package/dist/ui.js +1292 -0
  73. package/package.json +86 -4
package/dist/ui.css ADDED
@@ -0,0 +1,635 @@
1
+ /* Stilo default UI styles. */
2
+
3
+ /*
4
+ * Default values of the custom properties (docs/UI.md §7). `:where()` has no specificity, so any
5
+ * rule of the host page that sets them wins, whatever the order of the stylesheets.
6
+ */
7
+ :where(:root) {
8
+ --stilo-font-family: system-ui, sans-serif;
9
+ --stilo-font-size: 14px;
10
+
11
+ --stilo-color-text: #1f2328;
12
+ --stilo-color-muted: #59636e;
13
+ --stilo-color-bg: #ffffff;
14
+ --stilo-color-toolbar-bg: #f9fbfd;
15
+ --stilo-color-border: #d1d9e0;
16
+ --stilo-color-separator: #e4e8ec;
17
+ --stilo-color-hover: #eef1f4;
18
+ --stilo-color-hover-group: #f5f7f9;
19
+ --stilo-color-active: #dde4ee;
20
+ --stilo-color-focus: #0969da;
21
+ --stilo-color-error: #d1242f;
22
+
23
+ --stilo-radius: 6px;
24
+
25
+ --stilo-toolbar-padding-x: 2px;
26
+ --stilo-toolbar-padding-y: 4px;
27
+ --stilo-toolbar-gap: 2px;
28
+ --stilo-toolbar-group-gap: 4px;
29
+ --stilo-toolbar-separator-height: 18px;
30
+ --stilo-toolbar-sticky-top: 0;
31
+ --stilo-toolbar-shadow: 0 2px 6px rgb(0 0 0 / 0.08);
32
+ --stilo-z-toolbar: 1001;
33
+
34
+ --stilo-button-size: 30px;
35
+ --stilo-icon-size: 18px;
36
+
37
+ --stilo-popover-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
38
+ --stilo-z-popover: 1000;
39
+
40
+ --stilo-menu-h1-size: 1.5em;
41
+ --stilo-menu-h2-size: 1.3em;
42
+ --stilo-menu-h3-size: 1.15em;
43
+ --stilo-menu-h4-size: 1em;
44
+ --stilo-menu-h5-size: 1em;
45
+ --stilo-menu-h6-size: 1em;
46
+ }
47
+
48
+ /* Toolbar */
49
+ .stilo-toolbar {
50
+ display: flex;
51
+ flex-wrap: wrap;
52
+ gap: var(--stilo-toolbar-group-gap);
53
+ padding: var(--stilo-toolbar-padding-y) var(--stilo-toolbar-padding-x);
54
+ background: var(--stilo-color-toolbar-bg);
55
+ }
56
+
57
+ /*
58
+ * The toolbar and its sticky container have a background: their top corners follow the element
59
+ * that holds them, so that a rounded editor box keeps its corners (no `overflow` on the host,
60
+ * which would cut the popovers).
61
+ */
62
+ .stilo-toolbar-host,
63
+ .stilo-toolbar {
64
+ border-top-left-radius: inherit;
65
+ border-top-right-radius: inherit;
66
+ }
67
+
68
+ /* Sticky toolbar container (option `sticky`) */
69
+ .stilo-toolbar-host {
70
+ position: sticky;
71
+ top: var(--stilo-toolbar-sticky-top);
72
+ z-index: var(--stilo-z-toolbar);
73
+ background: var(--stilo-color-bg);
74
+ container-type: scroll-state;
75
+ }
76
+
77
+ /*
78
+ * A shadow while the toolbar is stuck at the top of the scrolling page. Pure CSS: browsers
79
+ * without scroll-state container queries ignore it and show the toolbar without shadow.
80
+ */
81
+ @container scroll-state(stuck: top) {
82
+ .stilo-toolbar {
83
+ box-shadow: var(--stilo-toolbar-shadow);
84
+ }
85
+ }
86
+
87
+ /* Group */
88
+ .stilo-toolbar__group {
89
+ display: flex;
90
+ gap: var(--stilo-toolbar-gap);
91
+ }
92
+
93
+ /* Separator: a short line, vertically centered, before every group after the first */
94
+ .stilo-toolbar__group:not(:first-child) {
95
+ position: relative;
96
+ padding-left: var(--stilo-toolbar-group-gap);
97
+ }
98
+
99
+ .stilo-toolbar__group:not(:first-child)::before {
100
+ content: "";
101
+ position: absolute;
102
+ top: 50%;
103
+ left: 0;
104
+ width: 1px;
105
+ height: var(--stilo-toolbar-separator-height);
106
+ background: var(--stilo-color-separator);
107
+ transform: translateY(-50%);
108
+ }
109
+
110
+ /* Button */
111
+ .stilo-toolbar__button {
112
+ display: flex;
113
+ align-items: center;
114
+ justify-content: center;
115
+ width: var(--stilo-button-size);
116
+ min-width: var(--stilo-button-size);
117
+ height: var(--stilo-button-size);
118
+ border: none;
119
+ border-radius: var(--stilo-radius);
120
+ background: transparent;
121
+ color: var(--stilo-color-text);
122
+ cursor: pointer;
123
+ font-family: var(--stilo-font-family);
124
+ font-size: var(--stilo-font-size);
125
+ padding: 0;
126
+ margin: 0;
127
+ transition: background-color 0.15s;
128
+ }
129
+
130
+ .stilo-toolbar__button:hover {
131
+ background: var(--stilo-color-hover);
132
+ }
133
+
134
+ .stilo-toolbar__button:focus-visible {
135
+ outline: 2px solid var(--stilo-color-focus);
136
+ outline-offset: 2px;
137
+ }
138
+
139
+ .stilo-toolbar__button.stilo-toolbar__button--active {
140
+ background: var(--stilo-color-active);
141
+ }
142
+
143
+ .stilo-toolbar__button[aria-disabled="true"] {
144
+ opacity: 0.4;
145
+ cursor: default;
146
+ }
147
+
148
+ .stilo-toolbar__button[aria-disabled="true"]:hover {
149
+ background: transparent;
150
+ }
151
+
152
+ /* Icon */
153
+ .stilo-icon {
154
+ width: var(--stilo-icon-size);
155
+ height: var(--stilo-icon-size);
156
+ color: var(--stilo-color-text);
157
+ }
158
+
159
+ /* Popover */
160
+ .stilo-popover-host {
161
+ position: relative;
162
+ }
163
+
164
+ .stilo-popover {
165
+ position: absolute;
166
+ top: 0;
167
+ left: 0;
168
+ width: max-content;
169
+ background: var(--stilo-color-bg);
170
+ border: 1px solid var(--stilo-color-border);
171
+ border-radius: var(--stilo-radius);
172
+ box-shadow: var(--stilo-popover-shadow);
173
+ z-index: var(--stilo-z-popover);
174
+ padding: 4px;
175
+ }
176
+
177
+ /* A component class with its own `display` must not show a closed popover. */
178
+ .stilo-popover[hidden] {
179
+ display: none;
180
+ }
181
+
182
+ /* Dropdown */
183
+ .stilo-dropdown__trigger {
184
+ width: auto;
185
+ min-width: 120px;
186
+ justify-content: space-between;
187
+ padding: 0 8px;
188
+ }
189
+
190
+ .stilo-dropdown__value {
191
+ overflow: hidden;
192
+ text-overflow: ellipsis;
193
+ white-space: nowrap;
194
+ }
195
+
196
+ .stilo-dropdown__menu {
197
+ min-width: 160px;
198
+ }
199
+
200
+ .stilo-dropdown__option {
201
+ display: flex;
202
+ align-items: center;
203
+ gap: 8px;
204
+ padding: 6px 8px;
205
+ border-radius: var(--stilo-radius);
206
+ cursor: pointer;
207
+ font-family: var(--stilo-font-family);
208
+ font-size: var(--stilo-font-size);
209
+ color: var(--stilo-color-text);
210
+ }
211
+
212
+ .stilo-dropdown__option:hover,
213
+ .stilo-dropdown__option:focus-visible {
214
+ background: var(--stilo-color-hover);
215
+ }
216
+
217
+ .stilo-dropdown__option:focus-visible {
218
+ outline: 2px solid var(--stilo-color-focus);
219
+ outline-offset: -2px;
220
+ }
221
+
222
+ .stilo-dropdown__option[aria-checked="true"] {
223
+ background: var(--stilo-color-active);
224
+ }
225
+
226
+ .stilo-dropdown__option[aria-disabled="true"] {
227
+ opacity: 0.4;
228
+ cursor: default;
229
+ }
230
+
231
+ .stilo-dropdown__option[aria-disabled="true"]:hover {
232
+ background: transparent;
233
+ }
234
+
235
+ .stilo-dropdown__label {
236
+ flex: 1;
237
+ }
238
+
239
+ .stilo-dropdown__shortcut {
240
+ font-size: 0.85em;
241
+ color: var(--stilo-color-muted);
242
+ }
243
+
244
+ /* Heading preview */
245
+ .stilo-dropdown__option--h1 .stilo-dropdown__label {
246
+ font-size: var(--stilo-menu-h1-size);
247
+ font-weight: 600;
248
+ }
249
+
250
+ .stilo-dropdown__option--h2 .stilo-dropdown__label {
251
+ font-size: var(--stilo-menu-h2-size);
252
+ font-weight: 600;
253
+ }
254
+
255
+ .stilo-dropdown__option--h3 .stilo-dropdown__label {
256
+ font-size: var(--stilo-menu-h3-size);
257
+ font-weight: 600;
258
+ }
259
+
260
+ .stilo-dropdown__option--h4 .stilo-dropdown__label {
261
+ font-size: var(--stilo-menu-h4-size);
262
+ font-weight: 600;
263
+ }
264
+
265
+ .stilo-dropdown__option--h5 .stilo-dropdown__label {
266
+ font-size: var(--stilo-menu-h5-size);
267
+ font-weight: 600;
268
+ }
269
+
270
+ .stilo-dropdown__option--h6 .stilo-dropdown__label {
271
+ font-size: var(--stilo-menu-h6-size);
272
+ font-weight: 600;
273
+ }
274
+
275
+ /* Link popover */
276
+ .stilo-link-popover__form {
277
+ display: flex;
278
+ flex-wrap: wrap;
279
+ align-items: center;
280
+ gap: 8px;
281
+ width: 320px;
282
+ padding: 4px;
283
+ font-family: var(--stilo-font-family);
284
+ font-size: var(--stilo-font-size);
285
+ color: var(--stilo-color-text);
286
+ }
287
+
288
+ .stilo-link-popover__url {
289
+ flex: 1 1 100%;
290
+ box-sizing: border-box;
291
+ padding: 6px 8px;
292
+ border: 1px solid var(--stilo-color-border);
293
+ border-radius: var(--stilo-radius);
294
+ background: var(--stilo-color-bg);
295
+ color: inherit;
296
+ font: inherit;
297
+ }
298
+
299
+ .stilo-link-popover__url:focus-visible {
300
+ outline: 2px solid var(--stilo-color-focus);
301
+ outline-offset: -1px;
302
+ }
303
+
304
+ .stilo-link-popover__url[aria-invalid="true"] {
305
+ border-color: var(--stilo-color-error);
306
+ }
307
+
308
+ .stilo-link-popover__new-tab {
309
+ display: flex;
310
+ flex: 1;
311
+ align-items: center;
312
+ gap: 6px;
313
+ cursor: pointer;
314
+ }
315
+
316
+ .stilo-link-popover__actions {
317
+ display: flex;
318
+ gap: 4px;
319
+ }
320
+
321
+ .stilo-link-popover__button {
322
+ padding: 4px 10px;
323
+ border: 1px solid var(--stilo-color-border);
324
+ border-radius: var(--stilo-radius);
325
+ background: var(--stilo-color-bg);
326
+ color: inherit;
327
+ cursor: pointer;
328
+ font: inherit;
329
+ }
330
+
331
+ .stilo-link-popover__button:hover {
332
+ background: var(--stilo-color-hover);
333
+ }
334
+
335
+ .stilo-link-popover__button:focus-visible {
336
+ outline: 2px solid var(--stilo-color-focus);
337
+ outline-offset: 1px;
338
+ }
339
+
340
+ .stilo-link-popover__button--primary,
341
+ .stilo-link-popover__button--primary:hover {
342
+ border-color: var(--stilo-color-focus);
343
+ background: var(--stilo-color-focus);
344
+ color: #ffffff;
345
+ }
346
+
347
+ /* Link bubble: small and unobtrusive */
348
+ .stilo-link-bubble {
349
+ display: flex;
350
+ gap: 1px;
351
+ padding: 2px;
352
+ }
353
+
354
+ .stilo-link-bubble__button {
355
+ display: flex;
356
+ align-items: center;
357
+ justify-content: center;
358
+ width: 24px;
359
+ height: 24px;
360
+ padding: 0;
361
+ border: none;
362
+ border-radius: var(--stilo-radius);
363
+ background: transparent;
364
+ color: var(--stilo-color-text);
365
+ cursor: pointer;
366
+ }
367
+
368
+ .stilo-link-bubble__button:hover {
369
+ background: var(--stilo-color-hover);
370
+ }
371
+
372
+ .stilo-link-bubble__button .stilo-icon {
373
+ width: 16px;
374
+ height: 16px;
375
+ }
376
+
377
+ /* Character picker: 10 columns (COLUMNS in character-picker.ts) */
378
+ .stilo-char-picker {
379
+ display: flex;
380
+ flex-direction: column;
381
+ gap: 4px;
382
+ font-family: var(--stilo-font-family);
383
+ font-size: var(--stilo-font-size);
384
+ color: var(--stilo-color-text);
385
+ }
386
+
387
+ .stilo-char-picker__search {
388
+ padding: 6px 8px;
389
+ border: 1px solid var(--stilo-color-border);
390
+ border-radius: var(--stilo-radius);
391
+ font: inherit;
392
+ }
393
+
394
+ .stilo-char-picker__search:focus-visible,
395
+ .stilo-char-picker__tab:focus-visible,
396
+ .stilo-char-picker__char:focus-visible {
397
+ outline: 2px solid var(--stilo-color-focus);
398
+ outline-offset: -2px;
399
+ }
400
+
401
+ .stilo-char-picker__tabs {
402
+ display: flex;
403
+ gap: 4px;
404
+ border-bottom: 1px solid var(--stilo-color-border);
405
+ }
406
+
407
+ .stilo-char-picker__tabs[hidden] {
408
+ display: none;
409
+ }
410
+
411
+ .stilo-char-picker__tab {
412
+ padding: 6px 10px;
413
+ border: none;
414
+ border-bottom: 2px solid transparent;
415
+ background: transparent;
416
+ color: var(--stilo-color-muted);
417
+ font: inherit;
418
+ cursor: pointer;
419
+ }
420
+
421
+ .stilo-char-picker__tab[aria-selected="true"] {
422
+ border-bottom-color: var(--stilo-color-focus);
423
+ color: var(--stilo-color-text);
424
+ }
425
+
426
+ .stilo-char-picker__panel {
427
+ max-height: 280px;
428
+ overflow-y: auto;
429
+ }
430
+
431
+ .stilo-char-picker__heading {
432
+ margin: 8px 0 4px;
433
+ color: var(--stilo-color-muted);
434
+ font-size: 0.85em;
435
+ }
436
+
437
+ .stilo-char-picker__grid {
438
+ display: grid;
439
+ grid-template-columns: repeat(10, 32px);
440
+ gap: 2px;
441
+ }
442
+
443
+ .stilo-char-picker__char {
444
+ width: 32px;
445
+ height: 32px;
446
+ padding: 0;
447
+ border: none;
448
+ border-radius: var(--stilo-radius);
449
+ background: transparent;
450
+ color: inherit;
451
+ font-size: 18px;
452
+ line-height: 1;
453
+ cursor: pointer;
454
+ }
455
+
456
+ .stilo-char-picker__char:hover {
457
+ background: var(--stilo-color-hover);
458
+ }
459
+
460
+ .stilo-char-picker__empty {
461
+ margin: 8px 0;
462
+ color: var(--stilo-color-muted);
463
+ }
464
+
465
+ /* Color split button (T-026): the main part shows the last used color under its icon */
466
+ .stilo-split {
467
+ display: flex;
468
+ }
469
+
470
+ /* Group hover: hovering one part lightly highlights both; the hovered part stays darker */
471
+ .stilo-split:hover
472
+ .stilo-toolbar__button:not(.stilo-toolbar__button--active, [aria-disabled="true"]) {
473
+ background: var(--stilo-color-hover-group);
474
+ }
475
+
476
+ .stilo-split
477
+ .stilo-toolbar__button:not(.stilo-toolbar__button--active, [aria-disabled="true"]):hover {
478
+ background: var(--stilo-color-hover);
479
+ }
480
+
481
+ .stilo-toolbar__button.stilo-split__main {
482
+ flex-direction: column;
483
+ gap: 1px;
484
+ border-top-right-radius: 0;
485
+ border-bottom-right-radius: 0;
486
+ }
487
+
488
+ .stilo-split__main .stilo-icon {
489
+ width: 16px;
490
+ height: 16px;
491
+ }
492
+
493
+ .stilo-split__color {
494
+ width: 16px;
495
+ height: 4px;
496
+ border-radius: 1px;
497
+ box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.15);
498
+ }
499
+
500
+ .stilo-toolbar__button.stilo-split__arrow {
501
+ width: 20px;
502
+ min-width: 20px;
503
+ border-top-left-radius: 0;
504
+ border-bottom-left-radius: 0;
505
+ }
506
+
507
+ .stilo-split__arrow .stilo-icon {
508
+ width: 12px;
509
+ height: 12px;
510
+ }
511
+
512
+ /* Color picker: 8 columns (COLUMNS in color-button.ts) */
513
+ .stilo-color-picker {
514
+ display: flex;
515
+ flex-direction: column;
516
+ gap: 6px;
517
+ padding: 4px;
518
+ font-family: var(--stilo-font-family);
519
+ font-size: var(--stilo-font-size);
520
+ color: var(--stilo-color-text);
521
+ }
522
+
523
+ .stilo-color-picker__actions {
524
+ display: flex;
525
+ align-items: center;
526
+ gap: 6px;
527
+ }
528
+
529
+ .stilo-color-picker__none,
530
+ .stilo-color-picker__default {
531
+ flex: 1;
532
+ padding: 4px 8px;
533
+ border: none;
534
+ border-radius: var(--stilo-radius);
535
+ background: transparent;
536
+ color: inherit;
537
+ font: inherit;
538
+ text-align: center;
539
+ cursor: pointer;
540
+ }
541
+
542
+ .stilo-color-picker__none:hover,
543
+ .stilo-color-picker__default:hover {
544
+ background: var(--stilo-color-hover);
545
+ }
546
+
547
+ .stilo-color-picker__default[aria-pressed="true"] {
548
+ background: var(--stilo-color-active);
549
+ }
550
+
551
+ .stilo-color-picker__default mark {
552
+ padding: 0 4px;
553
+ border-radius: 2px;
554
+ }
555
+
556
+ .stilo-color-picker__separator {
557
+ width: 1px;
558
+ height: 18px;
559
+ background: var(--stilo-color-separator);
560
+ }
561
+
562
+ .stilo-color-picker__grid {
563
+ display: grid;
564
+ grid-template-columns: repeat(8, 22px);
565
+ gap: 4px;
566
+ }
567
+
568
+ .stilo-color-picker__swatch {
569
+ width: 22px;
570
+ height: 22px;
571
+ padding: 0;
572
+ border: none;
573
+ border-radius: 4px;
574
+ box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.15);
575
+ cursor: pointer;
576
+ }
577
+
578
+ .stilo-color-picker__swatch:hover {
579
+ transform: scale(1.15);
580
+ }
581
+
582
+ .stilo-color-picker__swatch[aria-pressed="true"] {
583
+ outline: 2px solid var(--stilo-color-text);
584
+ outline-offset: 1px;
585
+ }
586
+
587
+ .stilo-color-picker__none:focus-visible,
588
+ .stilo-color-picker__default:focus-visible,
589
+ .stilo-color-picker__swatch:focus-visible,
590
+ .stilo-color-picker__value:focus-visible,
591
+ .stilo-color-picker__native:focus-visible,
592
+ .stilo-color-picker__apply:focus-visible {
593
+ outline: 2px solid var(--stilo-color-focus);
594
+ outline-offset: 1px;
595
+ }
596
+
597
+ .stilo-color-picker__custom {
598
+ display: flex;
599
+ gap: 4px;
600
+ align-items: center;
601
+ margin: 0;
602
+ }
603
+
604
+ .stilo-color-picker__native {
605
+ width: 32px;
606
+ height: 28px;
607
+ padding: 0;
608
+ border: 1px solid var(--stilo-color-border);
609
+ border-radius: var(--stilo-radius);
610
+ background: var(--stilo-color-bg);
611
+ cursor: pointer;
612
+ }
613
+
614
+ .stilo-color-picker__value {
615
+ flex: 1;
616
+ min-width: 0;
617
+ padding: 4px 8px;
618
+ border: 1px solid var(--stilo-color-border);
619
+ border-radius: var(--stilo-radius);
620
+ font: inherit;
621
+ }
622
+
623
+ .stilo-color-picker__value[aria-invalid="true"] {
624
+ border-color: var(--stilo-color-error);
625
+ }
626
+
627
+ .stilo-color-picker__apply {
628
+ padding: 4px 10px;
629
+ border: 1px solid var(--stilo-color-focus);
630
+ border-radius: var(--stilo-radius);
631
+ background: var(--stilo-color-focus);
632
+ color: #ffffff;
633
+ font: inherit;
634
+ cursor: pointer;
635
+ }