payload-canvas 0.6.3 → 0.6.5

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 (60) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +3237 -3236
  3. package/dist/admin/aiKeyField.scss +58 -58
  4. package/dist/admin/diff/layoutDiff.scss +181 -181
  5. package/dist/admin/editor/assistant/assistant.scss +944 -944
  6. package/dist/admin/editor/classes/manager.scss +262 -262
  7. package/dist/admin/editor/comments/comments.scss +539 -539
  8. package/dist/admin/editor/dnd/dnd.scss +261 -261
  9. package/dist/admin/editor/editor.scss +2629 -2629
  10. package/dist/admin/editor/empty/empty.scss +92 -92
  11. package/dist/admin/editor/fields/fields.scss +778 -778
  12. package/dist/admin/editor/generate/generate.scss +276 -276
  13. package/dist/admin/editor/layout/layout.scss +240 -240
  14. package/dist/admin/editor/live/presence.scss +24 -24
  15. package/dist/admin/editor/locale/locale.scss +154 -154
  16. package/dist/admin/editor/media/media.scss +233 -233
  17. package/dist/admin/editor/menu/menu.scss +132 -132
  18. package/dist/admin/editor/motion/motion.scss +84 -84
  19. package/dist/admin/editor/sections/components.scss +238 -238
  20. package/dist/admin/editor/sections/variants.scss +90 -90
  21. package/dist/admin/editor/styles/ClassCss.js +3 -3
  22. package/dist/admin/editor/styles/classes.scss +381 -381
  23. package/dist/admin/editor/styles/styles.scss +1123 -1123
  24. package/dist/admin/editor/styles/tokens.js +2 -1
  25. package/dist/admin/editor/templates/templates.scss +654 -654
  26. package/dist/admin/editor/tooltip/tooltip.scss +39 -39
  27. package/dist/admin/editor/topbar/DocumentActions.js +1 -1
  28. package/dist/admin/editor/topbar/TopBar.js +2 -1
  29. package/dist/admin/editor/topbar/contentMode.scss +26 -26
  30. package/dist/admin/editor/topbar/screens/screens.scss +134 -134
  31. package/dist/admin/editor/topbar/settingsDrawer.scss +32 -32
  32. package/dist/admin/editor/topbar/tabTitle.d.ts +6 -0
  33. package/dist/admin/editor/topbar/tabTitle.js +9 -0
  34. package/dist/admin/editor/topbar/topbar.scss +645 -645
  35. package/dist/admin/editor/ui/controls.scss +320 -320
  36. package/dist/admin/forms/submissions.scss +197 -197
  37. package/dist/admin/layoutField.scss +69 -69
  38. package/dist/admin/templateConditions.scss +24 -24
  39. package/dist/ai/prompt.js +40 -40
  40. package/dist/blocks/client/marquee.js +14 -14
  41. package/dist/blocks/payload.js +13 -3
  42. package/dist/core/payloadBlocks.js +10 -1
  43. package/dist/core/responseError.d.ts +5 -0
  44. package/dist/core/responseError.js +8 -0
  45. package/dist/core/sections.d.ts +2 -0
  46. package/dist/core/sections.js +8 -0
  47. package/dist/css/index.d.ts +6 -0
  48. package/dist/css/index.js +40 -1
  49. package/dist/css/shared.js +2 -2
  50. package/dist/live/session.js +18 -0
  51. package/dist/live/storage.d.ts +5 -0
  52. package/dist/live/storage.js +20 -0
  53. package/dist/mcp/index.js +46 -19
  54. package/dist/mcp/shared.js +16 -16
  55. package/dist/plugin/index.d.ts +21 -1
  56. package/dist/plugin/index.js +46 -15
  57. package/dist/react/canvas/BuilderCanvas.js +76 -75
  58. package/dist/react/canvas/thumbnail/ThumbnailCanvas.js +8 -7
  59. package/dist/theme/admin/fields.scss +363 -363
  60. package/package.json +1 -1
@@ -1,1123 +1,1123 @@
1
- // Styles panel. Payload CSS variables only, no Tailwind (it would leak into the admin).
2
-
3
- @layer payload-default {
4
- .builder-styles {
5
- --bs-accent: var(--be-accent, var(--color-blue-500, #2f6fec));
6
- --bs-border: var(--theme-elevation-150);
7
- --bs-muted: var(--theme-elevation-600);
8
- --bs-accent-text: var(--be-accent-text, var(--theme-success-600));
9
- --bs-dim: var(--theme-elevation-400);
10
- --bs-h: 26px;
11
- /* One column grid for every row: label, control, reset button. */
12
- --bs-label: 84px;
13
- --bs-gutter: 18px;
14
- --bs-gap: 6px;
15
- --bs-override: var(--theme-warning-500, #d97706);
16
-
17
- display: flex;
18
- flex-direction: column;
19
- font-size: var(--be-text-m);
20
-
21
- // :where() keeps this reset weaker than the components' own borders (the segmented control).
22
- :where(fieldset) {
23
- min-width: 0;
24
- margin: 0;
25
- padding: 0;
26
- border: 0;
27
- }
28
-
29
- code {
30
- font-family: var(--font-mono, ui-monospace, monospace);
31
- font-size: var(--be-text-s);
32
- }
33
- }
34
-
35
- .builder-styles__hint {
36
- margin: 4px 0 8px;
37
- color: var(--bs-muted);
38
- font-size: var(--be-text-m);
39
- }
40
-
41
- .builder-styles__hint--error {
42
- color: var(--theme-error-500);
43
- }
44
-
45
- .builder-styles__link {
46
- padding: 0;
47
- border: 0;
48
- background: none;
49
- color: var(--bs-accent-text);
50
- font: inherit;
51
- text-decoration: underline;
52
- cursor: pointer;
53
- }
54
-
55
- .builder-styles__button {
56
- flex: none;
57
- height: var(--bs-h);
58
- padding: 0 10px;
59
- border: 1px solid var(--bs-border);
60
- border-radius: var(--style-radius-s, 4px);
61
- background: var(--theme-elevation-50);
62
- color: var(--theme-text);
63
- font: inherit;
64
- cursor: pointer;
65
-
66
- &:hover {
67
- border-color: var(--theme-elevation-300);
68
- }
69
- }
70
-
71
- .builder-styles__button--primary {
72
- border-color: var(--theme-elevation-800);
73
- background: var(--theme-elevation-800);
74
- color: var(--theme-elevation-0);
75
-
76
- &:hover {
77
- border-color: var(--theme-elevation-1000);
78
- background: var(--theme-elevation-1000);
79
- }
80
- }
81
-
82
- // -------------------------------------------------------------------------
83
- // Variant bar
84
- // -------------------------------------------------------------------------
85
-
86
- .builder-styles__variants {
87
- position: sticky;
88
- z-index: 2;
89
- top: -12px;
90
- display: flex;
91
- flex-direction: column;
92
- gap: 6px;
93
- margin: -4px 0 4px;
94
- padding: 4px 0 8px;
95
- border-bottom: 1px solid var(--bs-border);
96
- background: var(--theme-bg);
97
- }
98
-
99
- .builder-styles__breakpoints {
100
- display: grid;
101
- grid-template-columns: repeat(6, 1fr);
102
- gap: 3px;
103
- }
104
-
105
- .builder-styles__chip {
106
- position: relative;
107
- display: flex;
108
- align-items: center;
109
- justify-content: center;
110
- gap: 4px;
111
- min-width: 0;
112
- height: var(--bs-h);
113
- padding: 0 4px;
114
- border: 1px solid var(--bs-border);
115
- border-radius: var(--style-radius-s, 4px);
116
- background: var(--theme-elevation-0);
117
- color: var(--theme-text);
118
- font: inherit;
119
- font-size: var(--be-text-m);
120
- cursor: pointer;
121
-
122
- &:hover {
123
- border-color: var(--theme-elevation-300);
124
- }
125
-
126
- &[aria-pressed='true'] {
127
- border-color: var(--bs-accent);
128
- background: color-mix(in srgb, var(--bs-accent) 10%, var(--theme-elevation-0));
129
- color: var(--bs-accent-text);
130
- }
131
-
132
- .builder-styles__dot {
133
- position: absolute;
134
- top: 3px;
135
- right: 3px;
136
- }
137
- }
138
-
139
- .builder-styles__chip {
140
- flex-direction: column;
141
- gap: 0;
142
- height: 34px;
143
- line-height: 1.1;
144
- }
145
-
146
- .builder-styles__chip-name {
147
- font-weight: var(--be-weight-strong);
148
- }
149
-
150
- .builder-styles__chip-width {
151
- color: var(--bs-muted);
152
- font-size: var(--be-text-s);
153
- font-variant-numeric: tabular-nums;
154
- }
155
-
156
- .builder-styles__state-row {
157
- display: flex;
158
- align-items: center;
159
- justify-content: space-between;
160
- gap: 8px;
161
- }
162
-
163
- .builder-styles__state-field {
164
- display: inline-flex;
165
- align-items: center;
166
- gap: 6px;
167
- color: var(--bs-muted);
168
- font-size: var(--be-text-s);
169
-
170
- // Fixed width: fits "While pressed" and a dot, so the row never moves when the state changes.
171
- .builder-select {
172
- width: 118px;
173
- }
174
- }
175
-
176
- .builder-styles__variant-hint {
177
- margin: 0;
178
- color: var(--bs-muted);
179
- font-size: var(--be-text-s);
180
-
181
- strong {
182
- color: var(--theme-text);
183
- font-weight: var(--be-weight-strong);
184
- }
185
-
186
- code {
187
- margin-left: 2px;
188
- padding: 0 4px;
189
- border-radius: 3px;
190
- background: color-mix(in srgb, var(--bs-accent) 12%, transparent);
191
- color: var(--bs-accent-text);
192
- }
193
- }
194
-
195
- // The canvas is narrower than the chosen breakpoint: these styles are not visible right now.
196
- .builder-styles__width-hint {
197
- display: flex;
198
- align-items: center;
199
- justify-content: space-between;
200
- gap: 8px;
201
- margin: 0;
202
- padding: 6px 6px 6px 10px;
203
- border: 1px solid color-mix(in srgb, var(--theme-warning-650, #b07a00) 40%, transparent);
204
- border-radius: var(--style-radius-s, 4px);
205
- background: color-mix(in srgb, var(--theme-warning-650, #b07a00) 10%, transparent);
206
- color: var(--theme-text);
207
- font-size: var(--be-text-s);
208
- line-height: 1.4;
209
- }
210
-
211
- .builder-styles__width-action {
212
- display: inline-flex;
213
- flex: none;
214
- align-items: center;
215
- gap: 4px;
216
- height: 24px;
217
- padding: 0 8px;
218
- border: 1px solid var(--bs-border);
219
- border-radius: var(--style-radius-s, 4px);
220
- background: var(--theme-elevation-0);
221
- color: var(--theme-text);
222
- font: inherit;
223
- font-size: var(--be-text-s);
224
- font-weight: var(--be-weight-medium);
225
- cursor: pointer;
226
-
227
- &:hover {
228
- border-color: var(--bs-accent);
229
- color: var(--bs-accent-text);
230
- }
231
- }
232
-
233
- .builder-styles__dot {
234
- display: inline-block;
235
- flex: none;
236
- width: 5px;
237
- height: 5px;
238
- border-radius: 50%;
239
- // Also in a select list, which renders outside the panel.
240
- background: var(--bs-accent, var(--be-accent, var(--theme-success-500)));
241
- }
242
-
243
- // -------------------------------------------------------------------------
244
- // Sections
245
- // -------------------------------------------------------------------------
246
-
247
- .builder-styles__section {
248
- border-bottom: 1px solid var(--theme-elevation-100);
249
- }
250
-
251
- .builder-styles__section-head,
252
- .builder-styles__sub-head {
253
- display: flex;
254
- align-items: center;
255
- gap: 4px;
256
- width: 100%;
257
- padding: 8px 0;
258
- border: 0;
259
- background: none;
260
- color: var(--theme-text);
261
- font: inherit;
262
- font-size: var(--be-text-s);
263
- font-weight: var(--be-weight-strong);
264
- letter-spacing: 0.04em;
265
- text-transform: uppercase;
266
- text-align: left;
267
- cursor: pointer;
268
-
269
- .builder-styles__dot {
270
- margin-left: 4px;
271
- }
272
- }
273
-
274
- .builder-styles__sub-head {
275
- padding: 6px 0 4px;
276
- color: var(--bs-muted);
277
- font-size: var(--be-text-s);
278
- font-weight: var(--be-weight-medium);
279
- letter-spacing: 0;
280
- text-transform: none;
281
- }
282
-
283
- .builder-styles__chevron {
284
- display: grid;
285
- place-items: center;
286
- color: var(--bs-muted);
287
- transition: rotate 120ms ease;
288
-
289
- [aria-expanded='true'] > & {
290
- rotate: 90deg;
291
- }
292
- }
293
-
294
- .builder-styles__section-body {
295
- display: flex;
296
- flex-direction: column;
297
- gap: 4px;
298
- padding: 0 0 10px;
299
- }
300
-
301
- // Rows in a sub-section keep the panel's columns; only the label text steps in.
302
- .builder-styles__sub-body {
303
- display: flex;
304
- flex-direction: column;
305
- gap: 4px;
306
- padding-bottom: 4px;
307
-
308
- .builder-styles__label-cell,
309
- .builder-styles__mini-row > .builder-styles__label {
310
- padding-left: 18px;
311
- }
312
- }
313
-
314
- // -------------------------------------------------------------------------
315
- // Rows and inputs
316
- // -------------------------------------------------------------------------
317
-
318
- .builder-styles__row {
319
- display: grid;
320
- grid-template-columns: var(--bs-label) minmax(0, 1fr) var(--bs-gutter);
321
- align-items: center;
322
- gap: var(--bs-gap);
323
- min-height: 28px;
324
- }
325
-
326
- // The label and, after it, the override dot.
327
- .builder-styles__label-cell {
328
- display: flex;
329
- align-items: center;
330
- gap: 4px;
331
- min-width: 0;
332
- }
333
-
334
- .builder-styles__label {
335
- min-width: 0;
336
- overflow: hidden;
337
- color: var(--bs-muted);
338
- font-size: var(--be-text-m);
339
- text-overflow: ellipsis;
340
- white-space: nowrap;
341
- }
342
-
343
- // A value set at exactly this variant: the label turns blue (like Webflow). From a smaller
344
- // breakpoint or a shorthand: amber.
345
- [data-source='set'] > .builder-styles__label,
346
- .builder-styles__mini-caption[data-source='set'] > .builder-styles__mini-text {
347
- color: var(--bs-accent-text);
348
- }
349
-
350
- [data-source='inherited'] > .builder-styles__label,
351
- [data-source='shorthand'] > .builder-styles__label,
352
- .builder-styles__mini-caption[data-source='inherited'] > .builder-styles__mini-text,
353
- .builder-styles__mini-caption[data-source='shorthand'] > .builder-styles__mini-text {
354
- color: var(--theme-warning-600, #b7791f);
355
- }
356
-
357
- .builder-styles__control {
358
- display: flex;
359
- min-width: 0;
360
- }
361
-
362
- // A larger breakpoint wins on the canvas: a 6px dot after the label. The button is 14px for
363
- // the pointer; the dot is drawn inside it.
364
- .builder-styles__override-mark {
365
- display: grid;
366
- flex: none;
367
- place-items: center;
368
- width: 14px;
369
- height: 14px;
370
- margin: 0 -4px 0 -2px;
371
- padding: 0;
372
- border: 0;
373
- border-radius: 50%;
374
- background: none;
375
- cursor: pointer;
376
-
377
- &::before {
378
- content: '';
379
- width: 6px;
380
- height: 6px;
381
- border-radius: 50%;
382
- background: var(--bs-override);
383
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--bs-override) 22%, transparent);
384
- }
385
-
386
- &:hover::before,
387
- &[aria-expanded='true']::before {
388
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-override) 32%, transparent);
389
- }
390
-
391
- &:focus-visible {
392
- outline: 1px solid var(--bs-accent);
393
- }
394
- }
395
-
396
- // Only while open: `display` would otherwise beat the browser's rule that hides a closed popover.
397
- .builder-styles__popover--override:popover-open {
398
- display: flex;
399
- flex-direction: column;
400
- gap: 8px;
401
- width: 248px;
402
- padding: 10px;
403
- }
404
-
405
- .builder-styles__override-text {
406
- margin: 0;
407
- color: var(--theme-elevation-800);
408
- font-size: var(--be-text-m);
409
- line-height: 1.45;
410
-
411
- code {
412
- padding: 0 3px;
413
- border-radius: 3px;
414
- background: var(--theme-elevation-100);
415
- color: var(--theme-text);
416
- }
417
- }
418
-
419
- .builder-styles__override-actions {
420
- display: flex;
421
- flex-wrap: wrap;
422
- gap: 6px;
423
-
424
- .builder-styles__button {
425
- height: 24px;
426
- padding: 0 8px;
427
- font-size: var(--be-text-s);
428
- font-weight: var(--be-weight-medium);
429
- }
430
- }
431
-
432
- // A box model side the canvas does not show: a small amber dot in its top-right corner.
433
- .builder-styles__cell[data-overridden] {
434
- background-image: radial-gradient(circle at calc(100% - 4px) 4px, var(--bs-override) 2px, transparent 2.5px);
435
- }
436
-
437
- .builder-styles__input,
438
- .builder-styles__raw-input {
439
- width: 100%;
440
- min-width: 0;
441
- height: var(--bs-h);
442
- padding: 0 6px;
443
- border: 1px solid var(--bs-border);
444
- border-radius: var(--style-radius-s, 4px);
445
- background: var(--theme-input-bg, var(--theme-elevation-0));
446
- color: var(--theme-text);
447
- font: inherit;
448
- font-size: var(--be-text-m);
449
-
450
- &:hover {
451
- border-color: var(--theme-elevation-250);
452
- }
453
-
454
- &:focus {
455
- border-color: var(--bs-accent);
456
- outline: 0;
457
- box-shadow: 0 0 0 1px var(--bs-accent);
458
- }
459
-
460
- &::placeholder {
461
- color: var(--bs-dim);
462
- }
463
- }
464
-
465
- // The "…" list next to a segmented control (`Segmented` in controls.tsx). Highlighted like an
466
- // active segment while one of its options is the value.
467
- .builder-styles__more.builder-select {
468
- flex: none;
469
- width: var(--bs-h);
470
- margin-left: 3px;
471
-
472
- &[data-active] {
473
- background: var(--theme-elevation-150);
474
- color: var(--theme-text);
475
- }
476
-
477
- &[data-active][data-source='inherited'],
478
- &[data-active][data-source='shorthand'] {
479
- background: var(--theme-elevation-50);
480
- color: var(--theme-warning-600, #b7791f);
481
- }
482
- }
483
-
484
- .builder-styles__reset {
485
- display: grid;
486
- place-items: center;
487
- width: 18px;
488
- height: 18px;
489
- padding: 0;
490
- border: 0;
491
- border-radius: 3px;
492
- background: none;
493
- color: var(--bs-muted);
494
- cursor: pointer;
495
-
496
- &[hidden] {
497
- display: grid;
498
- visibility: hidden;
499
- }
500
-
501
- &:hover {
502
- background: var(--theme-elevation-100);
503
- color: var(--theme-error-500);
504
- }
505
-
506
- svg {
507
- width: 12px;
508
- height: 12px;
509
- }
510
- }
511
-
512
- .builder-styles__with-toggle {
513
- display: flex;
514
- flex: 1;
515
- gap: 4px;
516
- min-width: 0;
517
- }
518
-
519
- .builder-styles__icon-button {
520
- display: grid;
521
- flex: none;
522
- place-items: center;
523
- width: var(--bs-h);
524
- height: var(--bs-h);
525
- padding: 0;
526
- border: 1px solid var(--bs-border);
527
- border-radius: var(--style-radius-s, 4px);
528
- background: var(--theme-elevation-0);
529
- color: var(--bs-muted);
530
- cursor: pointer;
531
-
532
- &[aria-pressed='true'] {
533
- border-color: var(--bs-accent);
534
- color: var(--bs-accent-text);
535
- }
536
- }
537
-
538
- // Segmented icon buttons
539
- .builder-styles__segmented-wrap {
540
- display: flex;
541
- flex: 1;
542
- min-width: 0;
543
- }
544
-
545
- .builder-styles__segmented {
546
- display: flex;
547
- flex: 1;
548
- min-width: 0;
549
- overflow: hidden;
550
- border: 1px solid var(--bs-border);
551
- border-radius: var(--style-radius-s, 4px);
552
- background: var(--theme-input-bg, var(--theme-elevation-0));
553
- }
554
-
555
- .builder-styles__segment {
556
- display: grid;
557
- flex: 1;
558
- place-items: center;
559
- min-width: 0;
560
- height: calc(var(--bs-h) - 2px);
561
- padding: 0 2px;
562
- border: 0;
563
- border-left: 1px solid var(--theme-elevation-100);
564
- background: none;
565
- color: var(--bs-muted);
566
- font: inherit;
567
- font-size: var(--be-text-m);
568
- cursor: pointer;
569
-
570
- &:first-child {
571
- border-left: 0;
572
- }
573
-
574
- &:hover {
575
- background: var(--theme-elevation-50);
576
- color: var(--theme-text);
577
- }
578
-
579
- &[aria-pressed='true'] {
580
- background: var(--theme-elevation-150);
581
- color: var(--theme-text);
582
- }
583
-
584
- // Active only because of an inherited value: lighter, so it reads as "not set here".
585
- &[aria-pressed='true'][data-source='inherited'],
586
- &[aria-pressed='true'][data-source='shorthand'] {
587
- background: var(--theme-elevation-50);
588
- color: var(--theme-warning-600, #b7791f);
589
- }
590
- }
591
-
592
- .builder-styles__segment-icon {
593
- display: grid;
594
- place-items: center;
595
- font-weight: var(--be-weight-strong);
596
- }
597
-
598
- .builder-styles__segment-text {
599
- overflow: hidden;
600
- text-overflow: ellipsis;
601
- white-space: nowrap;
602
- }
603
-
604
- .builder-styles__line {
605
- display: block;
606
- width: 16px;
607
- border-top: 2px solid currentColor;
608
-
609
- &[data-style='dashed'] {
610
- border-top-style: dashed;
611
- }
612
-
613
- &[data-style='dotted'] {
614
- border-top-style: dotted;
615
- }
616
- }
617
-
618
- // Slider
619
- .builder-styles__slider,
620
- .builder-styles__picker-row {
621
- display: flex;
622
- flex: 1;
623
- align-items: center;
624
- gap: 8px;
625
- min-width: 0;
626
- }
627
-
628
- .builder-styles__slider-value {
629
- min-width: 34px;
630
- color: var(--theme-text);
631
- font-variant-numeric: tabular-nums;
632
- text-align: right;
633
-
634
- &[data-source='inherited'],
635
- &[data-source='shorthand'],
636
- &[data-source='none'] {
637
- color: var(--bs-dim);
638
- }
639
- }
640
-
641
- // Compact fields with a caption (gap, size, sides, corners)
642
- .builder-styles__mini-row {
643
- display: grid;
644
- grid-template-columns: var(--bs-label) minmax(0, 1fr) var(--bs-gutter);
645
- align-items: end;
646
- gap: var(--bs-gap);
647
- }
648
-
649
- .builder-styles__mini-row > .builder-styles__label {
650
- padding-bottom: 5px;
651
- }
652
-
653
- .builder-styles__mini-fields {
654
- display: grid;
655
- grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
656
- gap: 4px;
657
- }
658
-
659
- .builder-styles__mini {
660
- display: flex;
661
- flex-direction: column;
662
- gap: 1px;
663
- min-width: 0;
664
- }
665
-
666
- .builder-styles__mini-caption {
667
- display: flex;
668
- align-items: center;
669
- gap: 4px;
670
- height: 16px;
671
- padding-left: 1px;
672
- color: var(--bs-muted);
673
- font-size: var(--be-text-s);
674
-
675
- .builder-styles__mini-text {
676
- min-width: 0;
677
- overflow: hidden;
678
- text-overflow: ellipsis;
679
- white-space: nowrap;
680
- }
681
-
682
- // Right after its caption, so it never reads as part of the next field's caption.
683
- .builder-styles__reset {
684
- width: 14px;
685
- height: 14px;
686
-
687
- svg {
688
- width: 10px;
689
- height: 10px;
690
- }
691
- }
692
- }
693
-
694
- // -------------------------------------------------------------------------
695
- // Box model
696
- // -------------------------------------------------------------------------
697
-
698
- .builder-styles__box-model {
699
- display: flex;
700
- flex-direction: column;
701
- gap: 6px;
702
- }
703
-
704
- .builder-styles__ring {
705
- position: relative;
706
- display: grid;
707
- grid-template:
708
- '. top .' 24px
709
- 'left inner right' minmax(24px, auto)
710
- '. bottom .' 24px
711
- / 46px minmax(0, 1fr) 46px;
712
- align-items: center;
713
- justify-items: center;
714
- border-radius: var(--style-radius-s, 4px);
715
- }
716
-
717
- .builder-styles__ring--margin {
718
- border: 1px dashed var(--theme-elevation-250);
719
- background: var(--theme-elevation-50);
720
- }
721
-
722
- .builder-styles__ring--padding {
723
- width: 100%;
724
- border: 1px solid var(--theme-elevation-200);
725
- background: var(--theme-elevation-100);
726
- }
727
-
728
- .builder-styles__ring-label {
729
- position: absolute;
730
- top: 3px;
731
- left: 6px;
732
- color: var(--bs-muted);
733
- font-size: var(--be-text-s);
734
- letter-spacing: 0.05em;
735
- text-transform: uppercase;
736
- pointer-events: none;
737
- }
738
-
739
- .builder-styles__ring-top {
740
- grid-area: top;
741
- }
742
-
743
- .builder-styles__ring-right {
744
- grid-area: right;
745
- }
746
-
747
- .builder-styles__ring-bottom {
748
- grid-area: bottom;
749
- }
750
-
751
- .builder-styles__ring-left {
752
- grid-area: left;
753
- }
754
-
755
- .builder-styles__ring-inner {
756
- display: flex;
757
- grid-area: inner;
758
- justify-content: center;
759
- width: 100%;
760
- }
761
-
762
- // The element itself: a shape, so it never reads as an input.
763
- .builder-styles__content-box {
764
- width: 100%;
765
- max-width: 96px;
766
- height: 16px;
767
- margin: 4px 0;
768
- border: 1px dashed var(--theme-elevation-300);
769
- border-radius: 2px;
770
- background: var(--theme-elevation-50);
771
- }
772
-
773
- .builder-styles__cell {
774
- width: 42px;
775
- height: 20px;
776
- padding: 0 2px;
777
- border: 1px solid transparent;
778
- border-radius: 3px;
779
- background: transparent;
780
- color: var(--theme-text);
781
- font: inherit;
782
- font-size: var(--be-text-s);
783
- font-variant-numeric: tabular-nums;
784
- text-align: center;
785
-
786
- &::placeholder {
787
- color: var(--bs-dim);
788
- }
789
-
790
- &:hover {
791
- border-color: var(--theme-elevation-250);
792
- background: var(--theme-elevation-0);
793
- }
794
-
795
- &:focus {
796
- border-color: var(--bs-accent);
797
- outline: 0;
798
- background: var(--theme-input-bg, var(--theme-elevation-0));
799
- }
800
-
801
- &[data-source='set'] {
802
- color: var(--bs-accent-text);
803
- font-weight: var(--be-weight-strong);
804
- }
805
- }
806
-
807
- .builder-styles__cell--empty {
808
- visibility: hidden;
809
- }
810
-
811
- // -------------------------------------------------------------------------
812
- // Popovers and suggestion lists
813
- // -------------------------------------------------------------------------
814
-
815
- .builder-styles__popover {
816
- position: fixed;
817
- inset: auto;
818
- margin: 0;
819
- padding: 0;
820
- overflow: auto;
821
- max-height: min(480px, calc(100vh - 16px));
822
- border: 1px solid var(--bs-border);
823
- border-radius: var(--style-radius-m, 6px);
824
- background: var(--theme-bg);
825
- color: var(--theme-text);
826
- font-size: var(--be-text-m);
827
- box-shadow: var(--be-shadow);
828
- }
829
-
830
- .builder-styles__popover--list {
831
- max-height: 260px;
832
- }
833
-
834
- .builder-styles__suggest {
835
- margin: 0;
836
- padding: 3px;
837
- list-style: none;
838
- }
839
-
840
- .builder-styles__suggest-item {
841
- display: flex;
842
- justify-content: space-between;
843
- gap: 12px;
844
- padding: 3px 6px;
845
- border-radius: 3px;
846
- cursor: pointer;
847
- white-space: nowrap;
848
-
849
- &[aria-selected='true'] {
850
- background: var(--theme-elevation-100);
851
- }
852
- }
853
-
854
- // A heading over a run of site classes of one group.
855
- .builder-styles__suggest-group {
856
- padding: 6px 6px 2px;
857
- color: var(--bs-muted);
858
- font-size: var(--be-text-s, 11px);
859
-
860
- &:not(:first-child) {
861
- margin-top: 2px;
862
- border-top: 1px solid var(--bs-border);
863
- }
864
- }
865
-
866
- // A site class: its label, with the class name small after it.
867
- .builder-styles__suggest-label {
868
- display: inline-flex;
869
- align-items: baseline;
870
- gap: 6px;
871
- min-width: 0;
872
- }
873
-
874
- .builder-styles__suggest-name {
875
- color: var(--bs-muted);
876
- font-size: var(--be-text-s, 11px);
877
- }
878
-
879
- .builder-styles__suggest-hint {
880
- color: var(--bs-muted);
881
- font-variant-numeric: tabular-nums;
882
- }
883
-
884
- .builder-styles__suggest-empty {
885
- margin: 0;
886
- padding: 6px 9px;
887
- color: var(--bs-muted);
888
- }
889
-
890
- // -------------------------------------------------------------------------
891
- // Color field and picker
892
- // -------------------------------------------------------------------------
893
-
894
- .builder-styles__color {
895
- display: flex;
896
- flex: 1;
897
- align-items: center;
898
- gap: 6px;
899
- min-width: 0;
900
- height: var(--bs-h);
901
- padding: 0 6px;
902
- border: 1px solid var(--bs-border);
903
- border-radius: var(--style-radius-s, 4px);
904
- background: var(--theme-input-bg, var(--theme-elevation-0));
905
- color: var(--theme-text);
906
- font: inherit;
907
- font-size: var(--be-text-m);
908
- text-align: left;
909
- cursor: pointer;
910
-
911
- &:hover {
912
- border-color: var(--theme-elevation-250);
913
- }
914
-
915
- &[data-source='inherited'],
916
- &[data-source='shorthand'],
917
- &[data-source='none'] {
918
- color: var(--bs-dim);
919
- }
920
- }
921
-
922
- .builder-styles__color-text {
923
- overflow: hidden;
924
- text-overflow: ellipsis;
925
- white-space: nowrap;
926
- }
927
-
928
- .builder-styles__swatch {
929
- --checker: conic-gradient(var(--theme-elevation-150) 25%, var(--theme-elevation-0) 0 50%, var(--theme-elevation-150) 0 75%, var(--theme-elevation-0) 0) 0 0 / 8px 8px;
930
-
931
- flex: none;
932
- width: 16px;
933
- height: 16px;
934
- border: 1px solid var(--theme-elevation-200);
935
- border-radius: 3px;
936
- background:
937
- linear-gradient(
938
- color-mix(in srgb, var(--swatch) var(--swatch-alpha, 100%), transparent),
939
- color-mix(in srgb, var(--swatch) var(--swatch-alpha, 100%), transparent)
940
- ),
941
- var(--checker);
942
-
943
- &[data-empty='true'] {
944
- background: linear-gradient(to top right, transparent 45%, var(--theme-error-500) 45% 55%, transparent 55%), var(--theme-elevation-0);
945
- }
946
- }
947
-
948
- .builder-styles__swatch--sm {
949
- width: 14px;
950
- height: 14px;
951
- }
952
-
953
- .builder-styles__picker {
954
- display: flex;
955
- flex-direction: column;
956
- gap: 10px;
957
- width: 340px;
958
- padding: 10px;
959
-
960
- section {
961
- display: flex;
962
- flex-direction: column;
963
- gap: 4px;
964
- }
965
- }
966
-
967
- .builder-styles__picker-head {
968
- display: flex;
969
- align-items: center;
970
- gap: 8px;
971
- }
972
-
973
- .builder-styles__picker-value {
974
- flex: 1;
975
- overflow: hidden;
976
- font-family: var(--font-mono, ui-monospace, monospace);
977
- font-size: var(--be-text-s);
978
- text-overflow: ellipsis;
979
- white-space: nowrap;
980
- }
981
-
982
- .builder-styles__picker-title {
983
- margin: 0;
984
- color: var(--bs-muted);
985
- font-size: var(--be-text-s);
986
- font-weight: var(--be-weight-strong);
987
- letter-spacing: 0.05em;
988
- text-transform: uppercase;
989
- }
990
-
991
- // Two columns. A name too long for its column wraps (see `.builder-styles__theme-color`).
992
- .builder-styles__theme-colors {
993
- display: grid;
994
- grid-template-columns: repeat(2, minmax(0, 1fr));
995
- gap: 2px;
996
- }
997
-
998
- .builder-styles__more-colors {
999
- margin-top: 4px;
1000
-
1001
- summary {
1002
- padding: 4px 2px;
1003
- color: var(--bs-muted);
1004
- font-size: var(--be-text-s);
1005
- cursor: pointer;
1006
- }
1007
- }
1008
-
1009
- .builder-styles__theme-color {
1010
- display: flex;
1011
- align-items: center;
1012
- gap: 6px;
1013
- min-width: 0;
1014
- padding: 3px 4px;
1015
- border: 1px solid transparent;
1016
- border-radius: 3px;
1017
- background: none;
1018
- color: var(--theme-text);
1019
- font: inherit;
1020
- font-size: var(--be-text-s);
1021
- text-align: left;
1022
- cursor: pointer;
1023
-
1024
- // Long names such as "secondary-foreground" or "sidebar-primary-foreground" wrap (after a
1025
- // hyphen first), so the full name stays readable. The title holds the value too.
1026
- span:last-child {
1027
- min-width: 0;
1028
- line-height: 1.25;
1029
- overflow-wrap: anywhere;
1030
- }
1031
-
1032
- &:hover {
1033
- background: var(--theme-elevation-100);
1034
- }
1035
-
1036
- &[aria-pressed='true'] {
1037
- border-color: var(--bs-accent);
1038
- }
1039
- }
1040
-
1041
- .builder-styles__palette {
1042
- display: grid;
1043
- grid-template-columns: repeat(var(--shades, 11), 1fr);
1044
- gap: 1px;
1045
- }
1046
-
1047
- .builder-styles__palette-cell {
1048
- aspect-ratio: 1;
1049
- padding: 0;
1050
- border: 0;
1051
- border-radius: 2px;
1052
- cursor: pointer;
1053
-
1054
- &:hover {
1055
- position: relative;
1056
- z-index: 1;
1057
- outline: 1px solid var(--theme-text);
1058
- }
1059
-
1060
- &[aria-pressed='true'] {
1061
- position: relative;
1062
- z-index: 2;
1063
- outline: 2px solid var(--bs-accent);
1064
- outline-offset: 1px;
1065
- }
1066
- }
1067
-
1068
- .builder-styles__picker-row {
1069
- .builder-styles__label {
1070
- flex: none;
1071
- width: 52px;
1072
- }
1073
-
1074
- .builder-styles__input {
1075
- flex: 1;
1076
- }
1077
- }
1078
-
1079
- .builder-styles__native-color {
1080
- flex: none;
1081
- width: var(--bs-h);
1082
- height: var(--bs-h);
1083
- padding: 1px;
1084
- border: 1px solid var(--bs-border);
1085
- border-radius: var(--style-radius-s, 4px);
1086
- background: var(--theme-elevation-0);
1087
- cursor: pointer;
1088
- }
1089
-
1090
- // -------------------------------------------------------------------------
1091
- // Small labels, classes as text ("Edit as text") and the custom CSS box
1092
- // -------------------------------------------------------------------------
1093
-
1094
- .builder-styles__raw-label {
1095
- color: var(--bs-muted);
1096
- font-size: var(--be-text-s);
1097
- font-weight: var(--be-weight-strong);
1098
- letter-spacing: 0.04em;
1099
- text-transform: uppercase;
1100
- }
1101
-
1102
- .builder-styles__raw-input {
1103
- // Grows with the class list (Chromium), so every class stays visible.
1104
- field-sizing: content;
1105
- height: auto;
1106
- min-height: 64px;
1107
- max-height: 240px;
1108
- padding: 6px;
1109
- font-family: var(--font-mono, ui-monospace, monospace);
1110
- font-size: var(--be-text-m);
1111
- line-height: 1.5;
1112
- resize: vertical;
1113
- }
1114
-
1115
- .builder-styles__visually-hidden {
1116
- position: absolute;
1117
- width: 1px;
1118
- height: 1px;
1119
- overflow: hidden;
1120
- clip-path: inset(50%);
1121
- white-space: nowrap;
1122
- }
1123
- }
1
+ // Styles panel. Payload CSS variables only, no Tailwind (it would leak into the admin).
2
+
3
+ @layer payload-default {
4
+ .builder-styles {
5
+ --bs-accent: var(--be-accent, var(--color-blue-500, #2f6fec));
6
+ --bs-border: var(--theme-elevation-150);
7
+ --bs-muted: var(--theme-elevation-600);
8
+ --bs-accent-text: var(--be-accent-text, var(--theme-success-600));
9
+ --bs-dim: var(--theme-elevation-400);
10
+ --bs-h: 26px;
11
+ /* One column grid for every row: label, control, reset button. */
12
+ --bs-label: 84px;
13
+ --bs-gutter: 18px;
14
+ --bs-gap: 6px;
15
+ --bs-override: var(--theme-warning-500, #d97706);
16
+
17
+ display: flex;
18
+ flex-direction: column;
19
+ font-size: var(--be-text-m);
20
+
21
+ // :where() keeps this reset weaker than the components' own borders (the segmented control).
22
+ :where(fieldset) {
23
+ min-width: 0;
24
+ margin: 0;
25
+ padding: 0;
26
+ border: 0;
27
+ }
28
+
29
+ code {
30
+ font-family: var(--font-mono, ui-monospace, monospace);
31
+ font-size: var(--be-text-s);
32
+ }
33
+ }
34
+
35
+ .builder-styles__hint {
36
+ margin: 4px 0 8px;
37
+ color: var(--bs-muted);
38
+ font-size: var(--be-text-m);
39
+ }
40
+
41
+ .builder-styles__hint--error {
42
+ color: var(--theme-error-500);
43
+ }
44
+
45
+ .builder-styles__link {
46
+ padding: 0;
47
+ border: 0;
48
+ background: none;
49
+ color: var(--bs-accent-text);
50
+ font: inherit;
51
+ text-decoration: underline;
52
+ cursor: pointer;
53
+ }
54
+
55
+ .builder-styles__button {
56
+ flex: none;
57
+ height: var(--bs-h);
58
+ padding: 0 10px;
59
+ border: 1px solid var(--bs-border);
60
+ border-radius: var(--style-radius-s, 4px);
61
+ background: var(--theme-elevation-50);
62
+ color: var(--theme-text);
63
+ font: inherit;
64
+ cursor: pointer;
65
+
66
+ &:hover {
67
+ border-color: var(--theme-elevation-300);
68
+ }
69
+ }
70
+
71
+ .builder-styles__button--primary {
72
+ border-color: var(--theme-elevation-800);
73
+ background: var(--theme-elevation-800);
74
+ color: var(--theme-elevation-0);
75
+
76
+ &:hover {
77
+ border-color: var(--theme-elevation-1000);
78
+ background: var(--theme-elevation-1000);
79
+ }
80
+ }
81
+
82
+ // -------------------------------------------------------------------------
83
+ // Variant bar
84
+ // -------------------------------------------------------------------------
85
+
86
+ .builder-styles__variants {
87
+ position: sticky;
88
+ z-index: 2;
89
+ top: -12px;
90
+ display: flex;
91
+ flex-direction: column;
92
+ gap: 6px;
93
+ margin: -4px 0 4px;
94
+ padding: 4px 0 8px;
95
+ border-bottom: 1px solid var(--bs-border);
96
+ background: var(--theme-bg);
97
+ }
98
+
99
+ .builder-styles__breakpoints {
100
+ display: grid;
101
+ grid-template-columns: repeat(6, 1fr);
102
+ gap: 3px;
103
+ }
104
+
105
+ .builder-styles__chip {
106
+ position: relative;
107
+ display: flex;
108
+ align-items: center;
109
+ justify-content: center;
110
+ gap: 4px;
111
+ min-width: 0;
112
+ height: var(--bs-h);
113
+ padding: 0 4px;
114
+ border: 1px solid var(--bs-border);
115
+ border-radius: var(--style-radius-s, 4px);
116
+ background: var(--theme-elevation-0);
117
+ color: var(--theme-text);
118
+ font: inherit;
119
+ font-size: var(--be-text-m);
120
+ cursor: pointer;
121
+
122
+ &:hover {
123
+ border-color: var(--theme-elevation-300);
124
+ }
125
+
126
+ &[aria-pressed='true'] {
127
+ border-color: var(--bs-accent);
128
+ background: color-mix(in srgb, var(--bs-accent) 10%, var(--theme-elevation-0));
129
+ color: var(--bs-accent-text);
130
+ }
131
+
132
+ .builder-styles__dot {
133
+ position: absolute;
134
+ top: 3px;
135
+ right: 3px;
136
+ }
137
+ }
138
+
139
+ .builder-styles__chip {
140
+ flex-direction: column;
141
+ gap: 0;
142
+ height: 34px;
143
+ line-height: 1.1;
144
+ }
145
+
146
+ .builder-styles__chip-name {
147
+ font-weight: var(--be-weight-strong);
148
+ }
149
+
150
+ .builder-styles__chip-width {
151
+ color: var(--bs-muted);
152
+ font-size: var(--be-text-s);
153
+ font-variant-numeric: tabular-nums;
154
+ }
155
+
156
+ .builder-styles__state-row {
157
+ display: flex;
158
+ align-items: center;
159
+ justify-content: space-between;
160
+ gap: 8px;
161
+ }
162
+
163
+ .builder-styles__state-field {
164
+ display: inline-flex;
165
+ align-items: center;
166
+ gap: 6px;
167
+ color: var(--bs-muted);
168
+ font-size: var(--be-text-s);
169
+
170
+ // Fixed width: fits "While pressed" and a dot, so the row never moves when the state changes.
171
+ .builder-select {
172
+ width: 118px;
173
+ }
174
+ }
175
+
176
+ .builder-styles__variant-hint {
177
+ margin: 0;
178
+ color: var(--bs-muted);
179
+ font-size: var(--be-text-s);
180
+
181
+ strong {
182
+ color: var(--theme-text);
183
+ font-weight: var(--be-weight-strong);
184
+ }
185
+
186
+ code {
187
+ margin-left: 2px;
188
+ padding: 0 4px;
189
+ border-radius: 3px;
190
+ background: color-mix(in srgb, var(--bs-accent) 12%, transparent);
191
+ color: var(--bs-accent-text);
192
+ }
193
+ }
194
+
195
+ // The canvas is narrower than the chosen breakpoint: these styles are not visible right now.
196
+ .builder-styles__width-hint {
197
+ display: flex;
198
+ align-items: center;
199
+ justify-content: space-between;
200
+ gap: 8px;
201
+ margin: 0;
202
+ padding: 6px 6px 6px 10px;
203
+ border: 1px solid color-mix(in srgb, var(--theme-warning-650, #b07a00) 40%, transparent);
204
+ border-radius: var(--style-radius-s, 4px);
205
+ background: color-mix(in srgb, var(--theme-warning-650, #b07a00) 10%, transparent);
206
+ color: var(--theme-text);
207
+ font-size: var(--be-text-s);
208
+ line-height: 1.4;
209
+ }
210
+
211
+ .builder-styles__width-action {
212
+ display: inline-flex;
213
+ flex: none;
214
+ align-items: center;
215
+ gap: 4px;
216
+ height: 24px;
217
+ padding: 0 8px;
218
+ border: 1px solid var(--bs-border);
219
+ border-radius: var(--style-radius-s, 4px);
220
+ background: var(--theme-elevation-0);
221
+ color: var(--theme-text);
222
+ font: inherit;
223
+ font-size: var(--be-text-s);
224
+ font-weight: var(--be-weight-medium);
225
+ cursor: pointer;
226
+
227
+ &:hover {
228
+ border-color: var(--bs-accent);
229
+ color: var(--bs-accent-text);
230
+ }
231
+ }
232
+
233
+ .builder-styles__dot {
234
+ display: inline-block;
235
+ flex: none;
236
+ width: 5px;
237
+ height: 5px;
238
+ border-radius: 50%;
239
+ // Also in a select list, which renders outside the panel.
240
+ background: var(--bs-accent, var(--be-accent, var(--theme-success-500)));
241
+ }
242
+
243
+ // -------------------------------------------------------------------------
244
+ // Sections
245
+ // -------------------------------------------------------------------------
246
+
247
+ .builder-styles__section {
248
+ border-bottom: 1px solid var(--theme-elevation-100);
249
+ }
250
+
251
+ .builder-styles__section-head,
252
+ .builder-styles__sub-head {
253
+ display: flex;
254
+ align-items: center;
255
+ gap: 4px;
256
+ width: 100%;
257
+ padding: 8px 0;
258
+ border: 0;
259
+ background: none;
260
+ color: var(--theme-text);
261
+ font: inherit;
262
+ font-size: var(--be-text-s);
263
+ font-weight: var(--be-weight-strong);
264
+ letter-spacing: 0.04em;
265
+ text-transform: uppercase;
266
+ text-align: left;
267
+ cursor: pointer;
268
+
269
+ .builder-styles__dot {
270
+ margin-left: 4px;
271
+ }
272
+ }
273
+
274
+ .builder-styles__sub-head {
275
+ padding: 6px 0 4px;
276
+ color: var(--bs-muted);
277
+ font-size: var(--be-text-s);
278
+ font-weight: var(--be-weight-medium);
279
+ letter-spacing: 0;
280
+ text-transform: none;
281
+ }
282
+
283
+ .builder-styles__chevron {
284
+ display: grid;
285
+ place-items: center;
286
+ color: var(--bs-muted);
287
+ transition: rotate 120ms ease;
288
+
289
+ [aria-expanded='true'] > & {
290
+ rotate: 90deg;
291
+ }
292
+ }
293
+
294
+ .builder-styles__section-body {
295
+ display: flex;
296
+ flex-direction: column;
297
+ gap: 4px;
298
+ padding: 0 0 10px;
299
+ }
300
+
301
+ // Rows in a sub-section keep the panel's columns; only the label text steps in.
302
+ .builder-styles__sub-body {
303
+ display: flex;
304
+ flex-direction: column;
305
+ gap: 4px;
306
+ padding-bottom: 4px;
307
+
308
+ .builder-styles__label-cell,
309
+ .builder-styles__mini-row > .builder-styles__label {
310
+ padding-left: 18px;
311
+ }
312
+ }
313
+
314
+ // -------------------------------------------------------------------------
315
+ // Rows and inputs
316
+ // -------------------------------------------------------------------------
317
+
318
+ .builder-styles__row {
319
+ display: grid;
320
+ grid-template-columns: var(--bs-label) minmax(0, 1fr) var(--bs-gutter);
321
+ align-items: center;
322
+ gap: var(--bs-gap);
323
+ min-height: 28px;
324
+ }
325
+
326
+ // The label and, after it, the override dot.
327
+ .builder-styles__label-cell {
328
+ display: flex;
329
+ align-items: center;
330
+ gap: 4px;
331
+ min-width: 0;
332
+ }
333
+
334
+ .builder-styles__label {
335
+ min-width: 0;
336
+ overflow: hidden;
337
+ color: var(--bs-muted);
338
+ font-size: var(--be-text-m);
339
+ text-overflow: ellipsis;
340
+ white-space: nowrap;
341
+ }
342
+
343
+ // A value set at exactly this variant: the label turns blue (like Webflow). From a smaller
344
+ // breakpoint or a shorthand: amber.
345
+ [data-source='set'] > .builder-styles__label,
346
+ .builder-styles__mini-caption[data-source='set'] > .builder-styles__mini-text {
347
+ color: var(--bs-accent-text);
348
+ }
349
+
350
+ [data-source='inherited'] > .builder-styles__label,
351
+ [data-source='shorthand'] > .builder-styles__label,
352
+ .builder-styles__mini-caption[data-source='inherited'] > .builder-styles__mini-text,
353
+ .builder-styles__mini-caption[data-source='shorthand'] > .builder-styles__mini-text {
354
+ color: var(--theme-warning-600, #b7791f);
355
+ }
356
+
357
+ .builder-styles__control {
358
+ display: flex;
359
+ min-width: 0;
360
+ }
361
+
362
+ // A larger breakpoint wins on the canvas: a 6px dot after the label. The button is 14px for
363
+ // the pointer; the dot is drawn inside it.
364
+ .builder-styles__override-mark {
365
+ display: grid;
366
+ flex: none;
367
+ place-items: center;
368
+ width: 14px;
369
+ height: 14px;
370
+ margin: 0 -4px 0 -2px;
371
+ padding: 0;
372
+ border: 0;
373
+ border-radius: 50%;
374
+ background: none;
375
+ cursor: pointer;
376
+
377
+ &::before {
378
+ content: '';
379
+ width: 6px;
380
+ height: 6px;
381
+ border-radius: 50%;
382
+ background: var(--bs-override);
383
+ box-shadow: 0 0 0 2px color-mix(in srgb, var(--bs-override) 22%, transparent);
384
+ }
385
+
386
+ &:hover::before,
387
+ &[aria-expanded='true']::before {
388
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-override) 32%, transparent);
389
+ }
390
+
391
+ &:focus-visible {
392
+ outline: 1px solid var(--bs-accent);
393
+ }
394
+ }
395
+
396
+ // Only while open: `display` would otherwise beat the browser's rule that hides a closed popover.
397
+ .builder-styles__popover--override:popover-open {
398
+ display: flex;
399
+ flex-direction: column;
400
+ gap: 8px;
401
+ width: 248px;
402
+ padding: 10px;
403
+ }
404
+
405
+ .builder-styles__override-text {
406
+ margin: 0;
407
+ color: var(--theme-elevation-800);
408
+ font-size: var(--be-text-m);
409
+ line-height: 1.45;
410
+
411
+ code {
412
+ padding: 0 3px;
413
+ border-radius: 3px;
414
+ background: var(--theme-elevation-100);
415
+ color: var(--theme-text);
416
+ }
417
+ }
418
+
419
+ .builder-styles__override-actions {
420
+ display: flex;
421
+ flex-wrap: wrap;
422
+ gap: 6px;
423
+
424
+ .builder-styles__button {
425
+ height: 24px;
426
+ padding: 0 8px;
427
+ font-size: var(--be-text-s);
428
+ font-weight: var(--be-weight-medium);
429
+ }
430
+ }
431
+
432
+ // A box model side the canvas does not show: a small amber dot in its top-right corner.
433
+ .builder-styles__cell[data-overridden] {
434
+ background-image: radial-gradient(circle at calc(100% - 4px) 4px, var(--bs-override) 2px, transparent 2.5px);
435
+ }
436
+
437
+ .builder-styles__input,
438
+ .builder-styles__raw-input {
439
+ width: 100%;
440
+ min-width: 0;
441
+ height: var(--bs-h);
442
+ padding: 0 6px;
443
+ border: 1px solid var(--bs-border);
444
+ border-radius: var(--style-radius-s, 4px);
445
+ background: var(--theme-input-bg, var(--theme-elevation-0));
446
+ color: var(--theme-text);
447
+ font: inherit;
448
+ font-size: var(--be-text-m);
449
+
450
+ &:hover {
451
+ border-color: var(--theme-elevation-250);
452
+ }
453
+
454
+ &:focus {
455
+ border-color: var(--bs-accent);
456
+ outline: 0;
457
+ box-shadow: 0 0 0 1px var(--bs-accent);
458
+ }
459
+
460
+ &::placeholder {
461
+ color: var(--bs-dim);
462
+ }
463
+ }
464
+
465
+ // The "…" list next to a segmented control (`Segmented` in controls.tsx). Highlighted like an
466
+ // active segment while one of its options is the value.
467
+ .builder-styles__more.builder-select {
468
+ flex: none;
469
+ width: var(--bs-h);
470
+ margin-left: 3px;
471
+
472
+ &[data-active] {
473
+ background: var(--theme-elevation-150);
474
+ color: var(--theme-text);
475
+ }
476
+
477
+ &[data-active][data-source='inherited'],
478
+ &[data-active][data-source='shorthand'] {
479
+ background: var(--theme-elevation-50);
480
+ color: var(--theme-warning-600, #b7791f);
481
+ }
482
+ }
483
+
484
+ .builder-styles__reset {
485
+ display: grid;
486
+ place-items: center;
487
+ width: 18px;
488
+ height: 18px;
489
+ padding: 0;
490
+ border: 0;
491
+ border-radius: 3px;
492
+ background: none;
493
+ color: var(--bs-muted);
494
+ cursor: pointer;
495
+
496
+ &[hidden] {
497
+ display: grid;
498
+ visibility: hidden;
499
+ }
500
+
501
+ &:hover {
502
+ background: var(--theme-elevation-100);
503
+ color: var(--theme-error-500);
504
+ }
505
+
506
+ svg {
507
+ width: 12px;
508
+ height: 12px;
509
+ }
510
+ }
511
+
512
+ .builder-styles__with-toggle {
513
+ display: flex;
514
+ flex: 1;
515
+ gap: 4px;
516
+ min-width: 0;
517
+ }
518
+
519
+ .builder-styles__icon-button {
520
+ display: grid;
521
+ flex: none;
522
+ place-items: center;
523
+ width: var(--bs-h);
524
+ height: var(--bs-h);
525
+ padding: 0;
526
+ border: 1px solid var(--bs-border);
527
+ border-radius: var(--style-radius-s, 4px);
528
+ background: var(--theme-elevation-0);
529
+ color: var(--bs-muted);
530
+ cursor: pointer;
531
+
532
+ &[aria-pressed='true'] {
533
+ border-color: var(--bs-accent);
534
+ color: var(--bs-accent-text);
535
+ }
536
+ }
537
+
538
+ // Segmented icon buttons
539
+ .builder-styles__segmented-wrap {
540
+ display: flex;
541
+ flex: 1;
542
+ min-width: 0;
543
+ }
544
+
545
+ .builder-styles__segmented {
546
+ display: flex;
547
+ flex: 1;
548
+ min-width: 0;
549
+ overflow: hidden;
550
+ border: 1px solid var(--bs-border);
551
+ border-radius: var(--style-radius-s, 4px);
552
+ background: var(--theme-input-bg, var(--theme-elevation-0));
553
+ }
554
+
555
+ .builder-styles__segment {
556
+ display: grid;
557
+ flex: 1;
558
+ place-items: center;
559
+ min-width: 0;
560
+ height: calc(var(--bs-h) - 2px);
561
+ padding: 0 2px;
562
+ border: 0;
563
+ border-left: 1px solid var(--theme-elevation-100);
564
+ background: none;
565
+ color: var(--bs-muted);
566
+ font: inherit;
567
+ font-size: var(--be-text-m);
568
+ cursor: pointer;
569
+
570
+ &:first-child {
571
+ border-left: 0;
572
+ }
573
+
574
+ &:hover {
575
+ background: var(--theme-elevation-50);
576
+ color: var(--theme-text);
577
+ }
578
+
579
+ &[aria-pressed='true'] {
580
+ background: var(--theme-elevation-150);
581
+ color: var(--theme-text);
582
+ }
583
+
584
+ // Active only because of an inherited value: lighter, so it reads as "not set here".
585
+ &[aria-pressed='true'][data-source='inherited'],
586
+ &[aria-pressed='true'][data-source='shorthand'] {
587
+ background: var(--theme-elevation-50);
588
+ color: var(--theme-warning-600, #b7791f);
589
+ }
590
+ }
591
+
592
+ .builder-styles__segment-icon {
593
+ display: grid;
594
+ place-items: center;
595
+ font-weight: var(--be-weight-strong);
596
+ }
597
+
598
+ .builder-styles__segment-text {
599
+ overflow: hidden;
600
+ text-overflow: ellipsis;
601
+ white-space: nowrap;
602
+ }
603
+
604
+ .builder-styles__line {
605
+ display: block;
606
+ width: 16px;
607
+ border-top: 2px solid currentColor;
608
+
609
+ &[data-style='dashed'] {
610
+ border-top-style: dashed;
611
+ }
612
+
613
+ &[data-style='dotted'] {
614
+ border-top-style: dotted;
615
+ }
616
+ }
617
+
618
+ // Slider
619
+ .builder-styles__slider,
620
+ .builder-styles__picker-row {
621
+ display: flex;
622
+ flex: 1;
623
+ align-items: center;
624
+ gap: 8px;
625
+ min-width: 0;
626
+ }
627
+
628
+ .builder-styles__slider-value {
629
+ min-width: 34px;
630
+ color: var(--theme-text);
631
+ font-variant-numeric: tabular-nums;
632
+ text-align: right;
633
+
634
+ &[data-source='inherited'],
635
+ &[data-source='shorthand'],
636
+ &[data-source='none'] {
637
+ color: var(--bs-dim);
638
+ }
639
+ }
640
+
641
+ // Compact fields with a caption (gap, size, sides, corners)
642
+ .builder-styles__mini-row {
643
+ display: grid;
644
+ grid-template-columns: var(--bs-label) minmax(0, 1fr) var(--bs-gutter);
645
+ align-items: end;
646
+ gap: var(--bs-gap);
647
+ }
648
+
649
+ .builder-styles__mini-row > .builder-styles__label {
650
+ padding-bottom: 5px;
651
+ }
652
+
653
+ .builder-styles__mini-fields {
654
+ display: grid;
655
+ grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
656
+ gap: 4px;
657
+ }
658
+
659
+ .builder-styles__mini {
660
+ display: flex;
661
+ flex-direction: column;
662
+ gap: 1px;
663
+ min-width: 0;
664
+ }
665
+
666
+ .builder-styles__mini-caption {
667
+ display: flex;
668
+ align-items: center;
669
+ gap: 4px;
670
+ height: 16px;
671
+ padding-left: 1px;
672
+ color: var(--bs-muted);
673
+ font-size: var(--be-text-s);
674
+
675
+ .builder-styles__mini-text {
676
+ min-width: 0;
677
+ overflow: hidden;
678
+ text-overflow: ellipsis;
679
+ white-space: nowrap;
680
+ }
681
+
682
+ // Right after its caption, so it never reads as part of the next field's caption.
683
+ .builder-styles__reset {
684
+ width: 14px;
685
+ height: 14px;
686
+
687
+ svg {
688
+ width: 10px;
689
+ height: 10px;
690
+ }
691
+ }
692
+ }
693
+
694
+ // -------------------------------------------------------------------------
695
+ // Box model
696
+ // -------------------------------------------------------------------------
697
+
698
+ .builder-styles__box-model {
699
+ display: flex;
700
+ flex-direction: column;
701
+ gap: 6px;
702
+ }
703
+
704
+ .builder-styles__ring {
705
+ position: relative;
706
+ display: grid;
707
+ grid-template:
708
+ '. top .' 24px
709
+ 'left inner right' minmax(24px, auto)
710
+ '. bottom .' 24px
711
+ / 46px minmax(0, 1fr) 46px;
712
+ align-items: center;
713
+ justify-items: center;
714
+ border-radius: var(--style-radius-s, 4px);
715
+ }
716
+
717
+ .builder-styles__ring--margin {
718
+ border: 1px dashed var(--theme-elevation-250);
719
+ background: var(--theme-elevation-50);
720
+ }
721
+
722
+ .builder-styles__ring--padding {
723
+ width: 100%;
724
+ border: 1px solid var(--theme-elevation-200);
725
+ background: var(--theme-elevation-100);
726
+ }
727
+
728
+ .builder-styles__ring-label {
729
+ position: absolute;
730
+ top: 3px;
731
+ left: 6px;
732
+ color: var(--bs-muted);
733
+ font-size: var(--be-text-s);
734
+ letter-spacing: 0.05em;
735
+ text-transform: uppercase;
736
+ pointer-events: none;
737
+ }
738
+
739
+ .builder-styles__ring-top {
740
+ grid-area: top;
741
+ }
742
+
743
+ .builder-styles__ring-right {
744
+ grid-area: right;
745
+ }
746
+
747
+ .builder-styles__ring-bottom {
748
+ grid-area: bottom;
749
+ }
750
+
751
+ .builder-styles__ring-left {
752
+ grid-area: left;
753
+ }
754
+
755
+ .builder-styles__ring-inner {
756
+ display: flex;
757
+ grid-area: inner;
758
+ justify-content: center;
759
+ width: 100%;
760
+ }
761
+
762
+ // The element itself: a shape, so it never reads as an input.
763
+ .builder-styles__content-box {
764
+ width: 100%;
765
+ max-width: 96px;
766
+ height: 16px;
767
+ margin: 4px 0;
768
+ border: 1px dashed var(--theme-elevation-300);
769
+ border-radius: 2px;
770
+ background: var(--theme-elevation-50);
771
+ }
772
+
773
+ .builder-styles__cell {
774
+ width: 42px;
775
+ height: 20px;
776
+ padding: 0 2px;
777
+ border: 1px solid transparent;
778
+ border-radius: 3px;
779
+ background: transparent;
780
+ color: var(--theme-text);
781
+ font: inherit;
782
+ font-size: var(--be-text-s);
783
+ font-variant-numeric: tabular-nums;
784
+ text-align: center;
785
+
786
+ &::placeholder {
787
+ color: var(--bs-dim);
788
+ }
789
+
790
+ &:hover {
791
+ border-color: var(--theme-elevation-250);
792
+ background: var(--theme-elevation-0);
793
+ }
794
+
795
+ &:focus {
796
+ border-color: var(--bs-accent);
797
+ outline: 0;
798
+ background: var(--theme-input-bg, var(--theme-elevation-0));
799
+ }
800
+
801
+ &[data-source='set'] {
802
+ color: var(--bs-accent-text);
803
+ font-weight: var(--be-weight-strong);
804
+ }
805
+ }
806
+
807
+ .builder-styles__cell--empty {
808
+ visibility: hidden;
809
+ }
810
+
811
+ // -------------------------------------------------------------------------
812
+ // Popovers and suggestion lists
813
+ // -------------------------------------------------------------------------
814
+
815
+ .builder-styles__popover {
816
+ position: fixed;
817
+ inset: auto;
818
+ margin: 0;
819
+ padding: 0;
820
+ overflow: auto;
821
+ max-height: min(480px, calc(100vh - 16px));
822
+ border: 1px solid var(--bs-border);
823
+ border-radius: var(--style-radius-m, 6px);
824
+ background: var(--theme-bg);
825
+ color: var(--theme-text);
826
+ font-size: var(--be-text-m);
827
+ box-shadow: var(--be-shadow);
828
+ }
829
+
830
+ .builder-styles__popover--list {
831
+ max-height: 260px;
832
+ }
833
+
834
+ .builder-styles__suggest {
835
+ margin: 0;
836
+ padding: 3px;
837
+ list-style: none;
838
+ }
839
+
840
+ .builder-styles__suggest-item {
841
+ display: flex;
842
+ justify-content: space-between;
843
+ gap: 12px;
844
+ padding: 3px 6px;
845
+ border-radius: 3px;
846
+ cursor: pointer;
847
+ white-space: nowrap;
848
+
849
+ &[aria-selected='true'] {
850
+ background: var(--theme-elevation-100);
851
+ }
852
+ }
853
+
854
+ // A heading over a run of site classes of one group.
855
+ .builder-styles__suggest-group {
856
+ padding: 6px 6px 2px;
857
+ color: var(--bs-muted);
858
+ font-size: var(--be-text-s, 11px);
859
+
860
+ &:not(:first-child) {
861
+ margin-top: 2px;
862
+ border-top: 1px solid var(--bs-border);
863
+ }
864
+ }
865
+
866
+ // A site class: its label, with the class name small after it.
867
+ .builder-styles__suggest-label {
868
+ display: inline-flex;
869
+ align-items: baseline;
870
+ gap: 6px;
871
+ min-width: 0;
872
+ }
873
+
874
+ .builder-styles__suggest-name {
875
+ color: var(--bs-muted);
876
+ font-size: var(--be-text-s, 11px);
877
+ }
878
+
879
+ .builder-styles__suggest-hint {
880
+ color: var(--bs-muted);
881
+ font-variant-numeric: tabular-nums;
882
+ }
883
+
884
+ .builder-styles__suggest-empty {
885
+ margin: 0;
886
+ padding: 6px 9px;
887
+ color: var(--bs-muted);
888
+ }
889
+
890
+ // -------------------------------------------------------------------------
891
+ // Color field and picker
892
+ // -------------------------------------------------------------------------
893
+
894
+ .builder-styles__color {
895
+ display: flex;
896
+ flex: 1;
897
+ align-items: center;
898
+ gap: 6px;
899
+ min-width: 0;
900
+ height: var(--bs-h);
901
+ padding: 0 6px;
902
+ border: 1px solid var(--bs-border);
903
+ border-radius: var(--style-radius-s, 4px);
904
+ background: var(--theme-input-bg, var(--theme-elevation-0));
905
+ color: var(--theme-text);
906
+ font: inherit;
907
+ font-size: var(--be-text-m);
908
+ text-align: left;
909
+ cursor: pointer;
910
+
911
+ &:hover {
912
+ border-color: var(--theme-elevation-250);
913
+ }
914
+
915
+ &[data-source='inherited'],
916
+ &[data-source='shorthand'],
917
+ &[data-source='none'] {
918
+ color: var(--bs-dim);
919
+ }
920
+ }
921
+
922
+ .builder-styles__color-text {
923
+ overflow: hidden;
924
+ text-overflow: ellipsis;
925
+ white-space: nowrap;
926
+ }
927
+
928
+ .builder-styles__swatch {
929
+ --checker: conic-gradient(var(--theme-elevation-150) 25%, var(--theme-elevation-0) 0 50%, var(--theme-elevation-150) 0 75%, var(--theme-elevation-0) 0) 0 0 / 8px 8px;
930
+
931
+ flex: none;
932
+ width: 16px;
933
+ height: 16px;
934
+ border: 1px solid var(--theme-elevation-200);
935
+ border-radius: 3px;
936
+ background:
937
+ linear-gradient(
938
+ color-mix(in srgb, var(--swatch) var(--swatch-alpha, 100%), transparent),
939
+ color-mix(in srgb, var(--swatch) var(--swatch-alpha, 100%), transparent)
940
+ ),
941
+ var(--checker);
942
+
943
+ &[data-empty='true'] {
944
+ background: linear-gradient(to top right, transparent 45%, var(--theme-error-500) 45% 55%, transparent 55%), var(--theme-elevation-0);
945
+ }
946
+ }
947
+
948
+ .builder-styles__swatch--sm {
949
+ width: 14px;
950
+ height: 14px;
951
+ }
952
+
953
+ .builder-styles__picker {
954
+ display: flex;
955
+ flex-direction: column;
956
+ gap: 10px;
957
+ width: 340px;
958
+ padding: 10px;
959
+
960
+ section {
961
+ display: flex;
962
+ flex-direction: column;
963
+ gap: 4px;
964
+ }
965
+ }
966
+
967
+ .builder-styles__picker-head {
968
+ display: flex;
969
+ align-items: center;
970
+ gap: 8px;
971
+ }
972
+
973
+ .builder-styles__picker-value {
974
+ flex: 1;
975
+ overflow: hidden;
976
+ font-family: var(--font-mono, ui-monospace, monospace);
977
+ font-size: var(--be-text-s);
978
+ text-overflow: ellipsis;
979
+ white-space: nowrap;
980
+ }
981
+
982
+ .builder-styles__picker-title {
983
+ margin: 0;
984
+ color: var(--bs-muted);
985
+ font-size: var(--be-text-s);
986
+ font-weight: var(--be-weight-strong);
987
+ letter-spacing: 0.05em;
988
+ text-transform: uppercase;
989
+ }
990
+
991
+ // Two columns. A name too long for its column wraps (see `.builder-styles__theme-color`).
992
+ .builder-styles__theme-colors {
993
+ display: grid;
994
+ grid-template-columns: repeat(2, minmax(0, 1fr));
995
+ gap: 2px;
996
+ }
997
+
998
+ .builder-styles__more-colors {
999
+ margin-top: 4px;
1000
+
1001
+ summary {
1002
+ padding: 4px 2px;
1003
+ color: var(--bs-muted);
1004
+ font-size: var(--be-text-s);
1005
+ cursor: pointer;
1006
+ }
1007
+ }
1008
+
1009
+ .builder-styles__theme-color {
1010
+ display: flex;
1011
+ align-items: center;
1012
+ gap: 6px;
1013
+ min-width: 0;
1014
+ padding: 3px 4px;
1015
+ border: 1px solid transparent;
1016
+ border-radius: 3px;
1017
+ background: none;
1018
+ color: var(--theme-text);
1019
+ font: inherit;
1020
+ font-size: var(--be-text-s);
1021
+ text-align: left;
1022
+ cursor: pointer;
1023
+
1024
+ // Long names such as "secondary-foreground" or "sidebar-primary-foreground" wrap (after a
1025
+ // hyphen first), so the full name stays readable. The title holds the value too.
1026
+ span:last-child {
1027
+ min-width: 0;
1028
+ line-height: 1.25;
1029
+ overflow-wrap: anywhere;
1030
+ }
1031
+
1032
+ &:hover {
1033
+ background: var(--theme-elevation-100);
1034
+ }
1035
+
1036
+ &[aria-pressed='true'] {
1037
+ border-color: var(--bs-accent);
1038
+ }
1039
+ }
1040
+
1041
+ .builder-styles__palette {
1042
+ display: grid;
1043
+ grid-template-columns: repeat(var(--shades, 11), 1fr);
1044
+ gap: 1px;
1045
+ }
1046
+
1047
+ .builder-styles__palette-cell {
1048
+ aspect-ratio: 1;
1049
+ padding: 0;
1050
+ border: 0;
1051
+ border-radius: 2px;
1052
+ cursor: pointer;
1053
+
1054
+ &:hover {
1055
+ position: relative;
1056
+ z-index: 1;
1057
+ outline: 1px solid var(--theme-text);
1058
+ }
1059
+
1060
+ &[aria-pressed='true'] {
1061
+ position: relative;
1062
+ z-index: 2;
1063
+ outline: 2px solid var(--bs-accent);
1064
+ outline-offset: 1px;
1065
+ }
1066
+ }
1067
+
1068
+ .builder-styles__picker-row {
1069
+ .builder-styles__label {
1070
+ flex: none;
1071
+ width: 52px;
1072
+ }
1073
+
1074
+ .builder-styles__input {
1075
+ flex: 1;
1076
+ }
1077
+ }
1078
+
1079
+ .builder-styles__native-color {
1080
+ flex: none;
1081
+ width: var(--bs-h);
1082
+ height: var(--bs-h);
1083
+ padding: 1px;
1084
+ border: 1px solid var(--bs-border);
1085
+ border-radius: var(--style-radius-s, 4px);
1086
+ background: var(--theme-elevation-0);
1087
+ cursor: pointer;
1088
+ }
1089
+
1090
+ // -------------------------------------------------------------------------
1091
+ // Small labels, classes as text ("Edit as text") and the custom CSS box
1092
+ // -------------------------------------------------------------------------
1093
+
1094
+ .builder-styles__raw-label {
1095
+ color: var(--bs-muted);
1096
+ font-size: var(--be-text-s);
1097
+ font-weight: var(--be-weight-strong);
1098
+ letter-spacing: 0.04em;
1099
+ text-transform: uppercase;
1100
+ }
1101
+
1102
+ .builder-styles__raw-input {
1103
+ // Grows with the class list (Chromium), so every class stays visible.
1104
+ field-sizing: content;
1105
+ height: auto;
1106
+ min-height: 64px;
1107
+ max-height: 240px;
1108
+ padding: 6px;
1109
+ font-family: var(--font-mono, ui-monospace, monospace);
1110
+ font-size: var(--be-text-m);
1111
+ line-height: 1.5;
1112
+ resize: vertical;
1113
+ }
1114
+
1115
+ .builder-styles__visually-hidden {
1116
+ position: absolute;
1117
+ width: 1px;
1118
+ height: 1px;
1119
+ overflow: hidden;
1120
+ clip-path: inset(50%);
1121
+ white-space: nowrap;
1122
+ }
1123
+ }