@x12i/charts 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,821 @@
1
+ /* =========================================================================
2
+ * @x12i/charts styles
3
+ *
4
+ * Tokens only. Every selector is wrapped in :where() so it has zero
5
+ * specificity and any app rule wins. Hooks are data-kit="chart-*" and data-*
6
+ * state attributes. Spacing and alignment use logical properties, so the
7
+ * HTML parts (legend, table, toolbar) follow the page direction. SVG geometry
8
+ * is physical by nature; the layout mirrors time and category axes itself.
9
+ *
10
+ * Color is never the only channel: series also differ by marker shape, dash
11
+ * pattern or hatch fill, and every mark has a text equivalent.
12
+ * ========================================================================= */
13
+
14
+ /* ----------------------------------------------------------------- Root */
15
+
16
+ :where([data-kit="chart"]) {
17
+ position: relative;
18
+ display: block;
19
+ box-sizing: border-box;
20
+ inline-size: 100%;
21
+ min-inline-size: 0;
22
+ color: var(--kit-color-text-primary);
23
+ font-family: var(--kit-font-family-sans);
24
+ font-size: var(--kit-font-size-12);
25
+ }
26
+
27
+ /* A sparkline sits inline with text and sizes itself from its svg. */
28
+ :where([data-kit="chart"][data-mark="sparkline"]) {
29
+ display: inline-block;
30
+ inline-size: auto;
31
+ vertical-align: middle;
32
+ }
33
+
34
+ :where([data-kit="chart-stage"]) {
35
+ position: relative;
36
+ }
37
+
38
+ :where([data-kit="chart-svg"]) {
39
+ display: block;
40
+ box-sizing: border-box;
41
+ inline-size: 100%;
42
+ max-inline-size: 100%;
43
+ block-size: auto;
44
+ overflow: visible;
45
+ touch-action: pan-y pinch-zoom;
46
+ -webkit-user-select: none;
47
+ user-select: none;
48
+ }
49
+
50
+ :where([data-kit="chart-svg"][data-activatable="true"]) {
51
+ cursor: pointer;
52
+ }
53
+
54
+ /* The whole plot gets a ring while it has keyboard focus; the active mark gets its own. */
55
+ :where([data-kit="chart-svg"][data-interactive="true"]:focus-visible) {
56
+ outline: var(--kit-border-width-focus) solid var(--kit-color-border-focus);
57
+ outline-offset: var(--kit-space-1);
58
+ border-radius: var(--kit-radius-control);
59
+ }
60
+
61
+ :where([data-kit="chart-canvas"]) {
62
+ display: block;
63
+ inline-size: 100%;
64
+ }
65
+
66
+ :where([data-kit="chart-note"]) {
67
+ margin-block: var(--kit-space-2);
68
+ margin-inline: 0;
69
+ color: var(--kit-color-text-secondary);
70
+ font-size: var(--kit-text-caption-size);
71
+ line-height: var(--kit-text-caption-line-height);
72
+ }
73
+
74
+ :where([data-kit="chart-warning"]) {
75
+ margin-block-end: var(--kit-space-2);
76
+ }
77
+
78
+ /* ---------------------------------------------------------------- Tones */
79
+
80
+ :where([data-kit="chart-svg"] [data-tone], [data-kit="chart-glyph"][data-tone]) {
81
+ --_tone: var(--kit-color-text-secondary);
82
+ }
83
+
84
+ :where([data-kit="chart-svg"] [data-tone="accent"], [data-kit="chart-glyph"][data-tone="accent"]) {
85
+ --_tone: var(--kit-color-accent-default);
86
+ }
87
+
88
+ :where([data-kit="chart-svg"] [data-tone="muted"], [data-kit="chart-glyph"][data-tone="muted"]) {
89
+ --_tone: var(--kit-color-chart-muted);
90
+ }
91
+
92
+ :where([data-kit="chart-svg"] [data-tone="reference"], [data-kit="chart-glyph"][data-tone="reference"]) {
93
+ --_tone: var(--kit-color-chart-reference);
94
+ }
95
+
96
+ :where([data-kit="chart-svg"] [data-tone="good"], [data-kit="chart-glyph"][data-tone="good"]) {
97
+ --_tone: var(--kit-color-chart-good);
98
+ }
99
+
100
+ :where([data-kit="chart-svg"] [data-tone="warning"], [data-kit="chart-glyph"][data-tone="warning"]) {
101
+ --_tone: var(--kit-color-chart-warning);
102
+ }
103
+
104
+ :where([data-kit="chart-svg"] [data-tone="critical"], [data-kit="chart-glyph"][data-tone="critical"]) {
105
+ --_tone: var(--kit-color-chart-critical);
106
+ }
107
+
108
+ :where([data-kit="chart-svg"] [data-tone="categorical-1"], [data-kit="chart-glyph"][data-tone="categorical-1"]) {
109
+ --_tone: var(--kit-color-chart-categorical-1);
110
+ }
111
+
112
+ :where([data-kit="chart-svg"] [data-tone="categorical-2"], [data-kit="chart-glyph"][data-tone="categorical-2"]) {
113
+ --_tone: var(--kit-color-chart-categorical-2);
114
+ }
115
+
116
+ :where([data-kit="chart-svg"] [data-tone="categorical-3"], [data-kit="chart-glyph"][data-tone="categorical-3"]) {
117
+ --_tone: var(--kit-color-chart-categorical-3);
118
+ }
119
+
120
+ :where([data-kit="chart-svg"] [data-tone="categorical-4"], [data-kit="chart-glyph"][data-tone="categorical-4"]) {
121
+ --_tone: var(--kit-color-chart-categorical-4);
122
+ }
123
+
124
+ :where([data-kit="chart-svg"] [data-tone="categorical-5"], [data-kit="chart-glyph"][data-tone="categorical-5"]) {
125
+ --_tone: var(--kit-color-chart-categorical-5);
126
+ }
127
+
128
+ :where([data-kit="chart-svg"] [data-tone="categorical-6"], [data-kit="chart-glyph"][data-tone="categorical-6"]) {
129
+ --_tone: var(--kit-color-chart-categorical-6);
130
+ }
131
+
132
+ :where([data-kit="chart-svg"] [data-tone="categorical-7"], [data-kit="chart-glyph"][data-tone="categorical-7"]) {
133
+ --_tone: var(--kit-color-chart-categorical-7);
134
+ }
135
+
136
+ :where([data-kit="chart-svg"] [data-tone="categorical-8"], [data-kit="chart-glyph"][data-tone="categorical-8"]) {
137
+ --_tone: var(--kit-color-chart-categorical-8);
138
+ }
139
+
140
+ /* ---------------------------------------------------------------- Axes */
141
+
142
+ :where([data-kit="chart-axis-line"], [data-kit="chart-tick-mark"]) {
143
+ fill: none;
144
+ stroke: var(--kit-color-chart-axis);
145
+ stroke-width: var(--kit-border-width-default);
146
+ }
147
+
148
+ :where([data-kit="chart-grid"]) {
149
+ fill: none;
150
+ stroke: var(--kit-color-chart-grid);
151
+ stroke-width: var(--kit-border-width-default);
152
+ }
153
+
154
+ /* The zero line is the baseline bars grow from, so it reads as an axis. */
155
+ :where([data-kit="chart-grid"][data-zero="true"]) {
156
+ stroke: var(--kit-color-chart-axis);
157
+ }
158
+
159
+ :where([data-kit="chart-tick-label"]) {
160
+ fill: var(--kit-color-chart-axis);
161
+ font-size: var(--kit-font-size-12);
162
+ font-variant-numeric: tabular-nums;
163
+ }
164
+
165
+ :where([data-kit="chart-axis-title"]) {
166
+ fill: var(--kit-color-text-secondary);
167
+ font-size: var(--kit-font-size-12);
168
+ font-weight: var(--kit-font-weight-medium);
169
+ }
170
+
171
+ /* --------------------------------------------------------------- Marks */
172
+
173
+ :where([data-kit="chart-bar"]) {
174
+ fill: var(--_tone);
175
+ stroke: var(--kit-color-bg-surface);
176
+ stroke-width: var(--kit-border-width-default);
177
+ rx: var(--kit-radius-2);
178
+ }
179
+
180
+ :where([data-kit="chart-area"]) {
181
+ fill: var(--_tone);
182
+ fill-opacity: 0.3;
183
+ stroke: none;
184
+ }
185
+
186
+ :where([data-kit="chart-line"]) {
187
+ fill: none;
188
+ stroke: var(--_tone);
189
+ stroke-width: var(--kit-border-width-2);
190
+ stroke-linecap: round;
191
+ stroke-linejoin: round;
192
+ }
193
+
194
+ :where([data-kit="chart-point"]) {
195
+ fill: var(--_tone);
196
+ stroke: var(--kit-color-bg-surface);
197
+ stroke-width: var(--kit-border-width-default);
198
+ }
199
+
200
+ :where([data-kit="chart-point"][data-open="true"]) {
201
+ fill: none;
202
+ stroke: var(--_tone);
203
+ stroke-width: var(--kit-border-width-2);
204
+ stroke-linecap: round;
205
+ }
206
+
207
+ :where([data-kit="chart-stem"]) {
208
+ stroke: var(--_tone);
209
+ stroke-width: var(--kit-border-width-2);
210
+ }
211
+
212
+ :where([data-kit="chart-connector"]) {
213
+ stroke: var(--kit-color-chart-reference);
214
+ stroke-width: var(--kit-border-width-default);
215
+ stroke-dasharray: var(--kit-space-1) var(--kit-space-1);
216
+ }
217
+
218
+ :where([data-kit="chart-cell"]) {
219
+ stroke: var(--kit-color-bg-surface);
220
+ stroke-width: var(--kit-border-width-default);
221
+ rx: var(--kit-radius-2);
222
+ }
223
+
224
+ :where([data-kit="chart-arc"]) {
225
+ fill: var(--_tone);
226
+ stroke: var(--kit-color-bg-surface);
227
+ stroke-width: var(--kit-border-width-2);
228
+ stroke-linejoin: round;
229
+ }
230
+
231
+ /* Gauge parts: a track behind, tinted bands, and the value arc on top. */
232
+ :where([data-kit="chart-arc"][data-role="track"]) {
233
+ fill: var(--kit-color-border-subtle);
234
+ stroke: none;
235
+ }
236
+
237
+ :where([data-kit="chart-arc"][data-role="band"]) {
238
+ fill: var(--_tone);
239
+ fill-opacity: 0.35;
240
+ stroke: none;
241
+ }
242
+
243
+ :where([data-kit="chart-arc"][data-role="value"]) {
244
+ fill: var(--_tone);
245
+ stroke: none;
246
+ }
247
+
248
+ /* Hatch overlays carry the series without color. */
249
+ :where([data-kit="chart-pattern"]) {
250
+ pointer-events: none;
251
+ }
252
+
253
+ :where([data-kit="chart-pattern-line"]) {
254
+ fill: none;
255
+ stroke: var(--kit-color-bg-surface);
256
+ stroke-width: var(--kit-border-width-default);
257
+ }
258
+
259
+ :where([data-kit="chart-pattern-dot"]) {
260
+ fill: var(--kit-color-bg-surface);
261
+ }
262
+
263
+ /* State: other marks fade when one is highlighted; the active mark gains an outline, not just a tint. */
264
+ :where([data-kit="chart-svg"] [data-muted="true"]) {
265
+ opacity: 0.3;
266
+ }
267
+
268
+ :where([data-kit="chart-svg"] [data-active="true"]) {
269
+ stroke: var(--kit-color-text-primary);
270
+ stroke-width: var(--kit-border-width-emphasis);
271
+ }
272
+
273
+ :where([data-kit="chart-point"][data-active="true"][data-open="true"]) {
274
+ stroke: var(--_tone);
275
+ }
276
+
277
+ /* A breach is outlined as well as announced in the tooltip and description. */
278
+ :where([data-kit="chart-svg"] [data-breach="true"]) {
279
+ stroke: var(--kit-color-chart-critical);
280
+ stroke-width: var(--kit-border-width-emphasis);
281
+ }
282
+
283
+ /* ---------------------------------------------------------- Annotations */
284
+
285
+ :where([data-kit="chart-annotation-line"]) {
286
+ fill: none;
287
+ stroke: var(--_tone);
288
+ stroke-width: var(--kit-border-width-default);
289
+ stroke-dasharray: var(--kit-space-2) var(--kit-space-1);
290
+ }
291
+
292
+ :where([data-kit="chart-annotation-line"][data-threshold="true"], [data-threshold="true"] [data-kit="chart-annotation-line"]) {
293
+ stroke-width: var(--kit-border-width-2);
294
+ }
295
+
296
+ :where([data-kit="chart-annotation-band"]) {
297
+ fill: var(--_tone);
298
+ fill-opacity: 0.12;
299
+ stroke: none;
300
+ }
301
+
302
+ :where([data-kit="chart-annotation-band"][data-forecast="true"]) {
303
+ stroke: var(--kit-color-chart-reference);
304
+ stroke-width: var(--kit-border-width-default);
305
+ stroke-dasharray: var(--kit-space-1) var(--kit-space-1);
306
+ }
307
+
308
+ :where([data-kit="chart-annotation-point"]) {
309
+ fill: var(--kit-color-bg-surface);
310
+ stroke: var(--_tone);
311
+ stroke-width: var(--kit-border-width-2);
312
+ }
313
+
314
+ /* ---------------------------------------------------------------- Labels */
315
+
316
+ :where([data-kit="chart-label"]) {
317
+ fill: var(--kit-color-text-primary);
318
+ stroke: var(--kit-color-bg-surface);
319
+ stroke-width: calc(var(--kit-border-width-2) * 1.5);
320
+ stroke-linejoin: round;
321
+ paint-order: stroke;
322
+ font-size: var(--kit-font-size-12);
323
+ font-variant-numeric: tabular-nums;
324
+ pointer-events: none;
325
+ }
326
+
327
+ :where([data-kit="chart-label"][data-label-kind="direct"], [data-kit="chart-label"][data-label-kind="annotation"]) {
328
+ font-weight: var(--kit-font-weight-semibold);
329
+ }
330
+
331
+ :where([data-kit="chart-label"][data-label-kind="center"]) {
332
+ font-size: var(--kit-font-size-24);
333
+ font-weight: var(--kit-font-weight-semibold);
334
+ }
335
+
336
+ :where([data-kit="chart-label"][data-label-kind="caption"]) {
337
+ fill: var(--kit-color-text-secondary);
338
+ }
339
+
340
+ /* ------------------------------------------------- Crosshair and focus */
341
+
342
+ :where([data-kit="chart-crosshair"] line) {
343
+ stroke: var(--kit-color-chart-axis);
344
+ stroke-width: var(--kit-border-width-default);
345
+ stroke-dasharray: var(--kit-space-1) var(--kit-space-1);
346
+ pointer-events: none;
347
+ }
348
+
349
+ :where([data-kit="chart-focus"]) {
350
+ fill: none;
351
+ stroke: var(--kit-color-border-focus);
352
+ stroke-width: var(--kit-border-width-focus);
353
+ rx: var(--kit-radius-2);
354
+ pointer-events: none;
355
+ }
356
+
357
+ /* --------------------------------------------------------------- Reveal */
358
+
359
+ @keyframes kit-chart-reveal {
360
+ from {
361
+ opacity: 0;
362
+ }
363
+ }
364
+
365
+ /* Opacity only, and it ends on each mark's own state (muted marks stay muted). */
366
+ :where(
367
+ [data-kit="chart-svg"][data-animate="true"] [data-kit="chart-bar"],
368
+ [data-kit="chart-svg"][data-animate="true"] [data-kit="chart-area"],
369
+ [data-kit="chart-svg"][data-animate="true"] [data-kit="chart-line"],
370
+ [data-kit="chart-svg"][data-animate="true"] [data-kit="chart-arc"],
371
+ [data-kit="chart-svg"][data-animate="true"] [data-kit="chart-cell"],
372
+ [data-kit="chart-svg"][data-animate="true"] [data-kit="chart-point"]
373
+ ) {
374
+ animation: kit-chart-reveal var(--kit-duration-slow) var(--kit-easing-standard) backwards;
375
+ }
376
+
377
+ @media (prefers-reduced-motion: reduce) {
378
+ :where([data-kit="chart-svg"][data-animate="true"] *) {
379
+ animation: none;
380
+ }
381
+ }
382
+
383
+ @media print {
384
+ :where([data-kit="chart-svg"][data-animate="true"] *) {
385
+ animation: none;
386
+ }
387
+ }
388
+
389
+ /* --------------------------------------------------------------- Legend */
390
+
391
+ :where([data-kit="chart-legend"]) {
392
+ margin-block: var(--kit-space-2);
393
+ }
394
+
395
+ :where([data-kit-slot="legend-list"]) {
396
+ display: flex;
397
+ flex-wrap: wrap;
398
+ gap: var(--kit-space-1) var(--kit-space-3);
399
+ margin: 0;
400
+ padding: 0;
401
+ list-style: none;
402
+ }
403
+
404
+ :where([data-kit="chart-legend-button"], [data-kit="chart-legend-key"]) {
405
+ display: inline-flex;
406
+ align-items: center;
407
+ gap: var(--kit-space-2);
408
+ box-sizing: border-box;
409
+ min-block-size: var(--kit-size-target-min);
410
+ padding-block: var(--kit-space-1);
411
+ padding-inline: var(--kit-space-2);
412
+ border: var(--kit-border-width-default) solid transparent;
413
+ border-radius: var(--kit-radius-control);
414
+ background: none;
415
+ color: var(--kit-color-text-primary);
416
+ font: inherit;
417
+ font-size: var(--kit-text-caption-size);
418
+ line-height: var(--kit-text-caption-line-height);
419
+ }
420
+
421
+ :where([data-kit="chart-legend-button"]) {
422
+ cursor: pointer;
423
+ }
424
+
425
+ :where([data-kit="chart-legend-button"]:hover) {
426
+ background-color: var(--kit-color-accent-subtle);
427
+ }
428
+
429
+ :where([data-kit="chart-legend-button"]:focus-visible) {
430
+ outline: var(--kit-border-width-focus) solid var(--kit-color-border-focus);
431
+ outline-offset: var(--kit-border-width-default);
432
+ }
433
+
434
+ /* A hidden series is struck through, so the state does not rely on fading alone. */
435
+ :where([data-kit="chart-legend-button"][data-hidden="true"]) {
436
+ color: var(--kit-color-text-tertiary);
437
+ text-decoration: line-through;
438
+ }
439
+
440
+ :where([data-kit="chart-legend-button"][data-hidden="true"] [data-kit="chart-glyph"]) {
441
+ opacity: 0.4;
442
+ }
443
+
444
+ /* Glyphs: a key swatch that mirrors the mark. */
445
+ :where([data-kit="chart-glyph"]) {
446
+ display: inline-block;
447
+ flex: none;
448
+ vertical-align: middle;
449
+ overflow: visible;
450
+ }
451
+
452
+ :where([data-kit="chart-glyph-line"]) {
453
+ fill: none;
454
+ stroke: var(--_tone);
455
+ stroke-width: var(--kit-border-width-2);
456
+ }
457
+
458
+ :where([data-kit="chart-glyph-area"]) {
459
+ fill: var(--_tone);
460
+ fill-opacity: 0.3;
461
+ }
462
+
463
+ :where([data-kit="chart-glyph-fill"]) {
464
+ fill: var(--_tone);
465
+ rx: var(--kit-radius-2);
466
+ }
467
+
468
+ :where([data-kit="chart-glyph-marker"]) {
469
+ fill: var(--_tone);
470
+ stroke: var(--kit-color-bg-surface);
471
+ stroke-width: var(--kit-border-width-default);
472
+ }
473
+
474
+ :where([data-kit="chart-glyph-marker"][data-open="true"]) {
475
+ fill: none;
476
+ stroke: var(--_tone);
477
+ stroke-width: var(--kit-border-width-2);
478
+ }
479
+
480
+ /* ------------------------------------------------------- Color scale legend */
481
+
482
+ :where([data-kit="chart-scale"]) {
483
+ display: flex;
484
+ align-items: center;
485
+ gap: var(--kit-space-2);
486
+ margin-block: var(--kit-space-2);
487
+ font-size: var(--kit-text-caption-size);
488
+ font-variant-numeric: tabular-nums;
489
+ color: var(--kit-color-text-secondary);
490
+ }
491
+
492
+ :where([data-kit-slot="scale-ramp"]) {
493
+ display: inline-block;
494
+ inline-size: calc(var(--kit-size-56) * 3);
495
+ block-size: var(--kit-space-3);
496
+ border: var(--kit-border-width-default) solid var(--kit-color-border-subtle);
497
+ border-radius: var(--kit-radius-2);
498
+ }
499
+
500
+ /* -------------------------------------------------------------- Tooltip */
501
+
502
+ :where([data-kit="chart-tooltip"]) {
503
+ --_tx: -50%;
504
+ --_ty: calc(-100% - var(--kit-space-3));
505
+
506
+ position: absolute;
507
+ z-index: var(--kit-z-tooltip);
508
+ box-sizing: border-box;
509
+ inline-size: max-content;
510
+ max-inline-size: calc(var(--kit-space-24) * 3);
511
+ translate: var(--_tx) var(--_ty);
512
+ padding-block: var(--kit-space-2);
513
+ padding-inline: var(--kit-space-3);
514
+ border: var(--kit-border-width-default) solid var(--kit-color-border-default);
515
+ border-radius: var(--kit-radius-overlay);
516
+ background-color: var(--kit-color-bg-overlay);
517
+ box-shadow: var(--kit-shadow-overlay);
518
+ color: var(--kit-color-text-primary);
519
+ font-size: var(--kit-text-caption-size);
520
+ line-height: var(--kit-text-caption-line-height);
521
+ }
522
+
523
+ :where([data-kit="chart-tooltip"][data-align="start"]) {
524
+ --_tx: 0;
525
+ }
526
+
527
+ :where([data-kit="chart-tooltip"][data-align="end"]) {
528
+ --_tx: -100%;
529
+ }
530
+
531
+ :where([data-kit="chart-tooltip"][data-placement="below"]) {
532
+ --_ty: var(--kit-space-3);
533
+ }
534
+
535
+ :where([data-kit-slot="tooltip-title"]) {
536
+ margin-block-end: var(--kit-space-1);
537
+ font-weight: var(--kit-font-weight-semibold);
538
+ }
539
+
540
+ :where([data-kit-slot="tooltip-rows"]) {
541
+ display: grid;
542
+ gap: var(--kit-space-1);
543
+ margin: 0;
544
+ padding: 0;
545
+ list-style: none;
546
+ }
547
+
548
+ :where([data-kit-slot="tooltip-row"]) {
549
+ display: grid;
550
+ grid-template-columns: auto 1fr auto;
551
+ align-items: center;
552
+ gap: var(--kit-space-2);
553
+ }
554
+
555
+ :where([data-kit-slot="tooltip-row"][data-active="true"]) {
556
+ font-weight: var(--kit-font-weight-semibold);
557
+ }
558
+
559
+ :where([data-kit-slot="tooltip-value"]) {
560
+ font-variant-numeric: tabular-nums;
561
+ font-weight: var(--kit-font-weight-semibold);
562
+ text-align: end;
563
+ }
564
+
565
+ :where([data-kit-slot="tooltip-note"]) {
566
+ grid-column: 2 / -1;
567
+ color: var(--kit-color-text-secondary);
568
+ }
569
+
570
+ /* --------------------------------------------------------------- States */
571
+
572
+ :where([data-kit="chart-state"]) {
573
+ display: flex;
574
+ flex-direction: column;
575
+ align-items: center;
576
+ justify-content: center;
577
+ gap: var(--kit-space-3);
578
+ box-sizing: border-box;
579
+ padding: var(--kit-space-6);
580
+ border: var(--kit-border-width-default) dashed var(--kit-color-border-subtle);
581
+ border-radius: var(--kit-radius-panel);
582
+ color: var(--kit-color-text-secondary);
583
+ text-align: center;
584
+ }
585
+
586
+ :where([data-kit="chart-state"][data-overlay="true"]) {
587
+ position: absolute;
588
+ inset: 0;
589
+ background-color: var(--kit-color-bg-surface);
590
+ }
591
+
592
+ :where([data-kit="chart-state"][data-state="error"]) {
593
+ border-style: solid;
594
+ border-color: var(--kit-color-status-danger-border);
595
+ background-color: var(--kit-color-status-danger-background);
596
+ color: var(--kit-color-status-danger-foreground);
597
+ }
598
+
599
+ :where([data-kit-slot="state-message"]) {
600
+ margin: 0;
601
+ font-size: var(--kit-text-body-size);
602
+ line-height: var(--kit-text-body-line-height);
603
+ }
604
+
605
+ /* --------------------------------------------------------- Frame and card */
606
+
607
+ :where([data-kit="chart-frame"]) {
608
+ display: grid;
609
+ gap: var(--kit-space-3);
610
+ box-sizing: border-box;
611
+ min-inline-size: 0;
612
+ margin: 0;
613
+ color: var(--kit-color-text-primary);
614
+ font-family: var(--kit-font-family-sans);
615
+ }
616
+
617
+ :where([data-kit="chart-frame"][data-variant="card"]) {
618
+ padding: var(--kit-space-4);
619
+ border: var(--kit-border-width-default) solid var(--kit-color-border-subtle);
620
+ border-radius: var(--kit-radius-panel);
621
+ background-color: var(--kit-color-bg-surface);
622
+ }
623
+
624
+ :where([data-kit-slot="frame-caption"]) {
625
+ display: grid;
626
+ gap: var(--kit-space-1);
627
+ }
628
+
629
+ :where([data-kit-slot="frame-title"]) {
630
+ margin: 0;
631
+ font-size: var(--kit-text-h4-size);
632
+ line-height: var(--kit-text-h4-line-height);
633
+ font-weight: var(--kit-text-h4-weight);
634
+ }
635
+
636
+ :where([data-kit-slot="frame-subtitle"], [data-kit-slot="frame-source"]) {
637
+ margin: 0;
638
+ color: var(--kit-color-text-secondary);
639
+ font-size: var(--kit-text-caption-size);
640
+ line-height: var(--kit-text-caption-line-height);
641
+ }
642
+
643
+ :where([data-kit-slot="frame-source"]) {
644
+ color: var(--kit-color-text-tertiary);
645
+ }
646
+
647
+ :where([data-kit-slot="frame-body"]) {
648
+ min-inline-size: 0;
649
+ }
650
+
651
+ :where([data-kit="chart-toolbar"]) {
652
+ display: flex;
653
+ flex-wrap: wrap;
654
+ align-items: center;
655
+ gap: var(--kit-space-2);
656
+ }
657
+
658
+ :where([data-kit="chart-icon"]) {
659
+ flex: none;
660
+ inline-size: var(--kit-size-icon-sm);
661
+ block-size: var(--kit-size-icon-sm);
662
+ fill: none;
663
+ stroke: currentcolor;
664
+ stroke-width: var(--kit-border-width-2);
665
+ stroke-linecap: round;
666
+ stroke-linejoin: round;
667
+ }
668
+
669
+ /* ---------------------------------------------------------------- Table */
670
+
671
+ :where([data-kit="chart-table"]) {
672
+ box-sizing: border-box;
673
+ max-block-size: calc(var(--kit-size-56) * 8);
674
+ overflow: auto;
675
+ border: var(--kit-border-width-default) solid var(--kit-color-border-subtle);
676
+ border-radius: var(--kit-radius-control);
677
+ background-color: var(--kit-color-bg-surface);
678
+ }
679
+
680
+ :where([data-kit="chart-table"]:focus-visible) {
681
+ outline: var(--kit-border-width-focus) solid var(--kit-color-border-focus);
682
+ outline-offset: var(--kit-border-width-default);
683
+ }
684
+
685
+ :where([data-kit="chart-table-element"]) {
686
+ inline-size: 100%;
687
+ border-collapse: collapse;
688
+ color: var(--kit-color-text-primary);
689
+ font-size: var(--kit-text-body-size);
690
+ line-height: var(--kit-text-body-line-height);
691
+ font-variant-numeric: tabular-nums;
692
+ }
693
+
694
+ :where([data-kit="chart-table-element"] caption) {
695
+ padding-block: var(--kit-space-2);
696
+ padding-inline: var(--kit-space-3);
697
+ color: var(--kit-color-text-secondary);
698
+ font-size: var(--kit-text-caption-size);
699
+ font-weight: var(--kit-font-weight-semibold);
700
+ text-align: start;
701
+ }
702
+
703
+ :where([data-kit="chart-table-element"] :is(th, td)) {
704
+ padding-block: var(--kit-space-2);
705
+ padding-inline: var(--kit-space-3);
706
+ border-block-end: var(--kit-border-width-default) solid var(--kit-color-border-subtle);
707
+ text-align: start;
708
+ }
709
+
710
+ :where([data-kit="chart-table-element"] thead th) {
711
+ position: sticky;
712
+ inset-block-start: 0;
713
+ background-color: var(--kit-color-bg-raised);
714
+ font-weight: var(--kit-font-weight-semibold);
715
+ }
716
+
717
+ :where([data-kit="chart-table-element"] tbody th) {
718
+ font-weight: var(--kit-font-weight-regular);
719
+ }
720
+
721
+ :where([data-kit="chart-table-element"] [data-numeric="true"]) {
722
+ text-align: end;
723
+ }
724
+
725
+ :where([data-kit-slot="table-note"]) {
726
+ margin: 0;
727
+ padding-block: var(--kit-space-2);
728
+ padding-inline: var(--kit-space-3);
729
+ color: var(--kit-color-text-secondary);
730
+ font-size: var(--kit-text-caption-size);
731
+ }
732
+
733
+ /* ----------------------------------------------------------------- Grid */
734
+
735
+ :where([data-kit="chart-grid-layout"]) {
736
+ display: grid;
737
+ gap: var(--kit-space-4);
738
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(var(--kit-space-24) * 4)), 1fr));
739
+ }
740
+
741
+ :where([data-kit="chart-grid-layout"][data-fixed="true"]) {
742
+ grid-template-columns: repeat(var(--_columns), minmax(0, 1fr));
743
+ }
744
+
745
+ /* -------------------------------------------------------- Forced colors */
746
+
747
+ @media (forced-colors: active) {
748
+ :where([data-kit="chart-bar"], [data-kit="chart-arc"], [data-kit="chart-point"], [data-kit="chart-glyph-fill"], [data-kit="chart-glyph-marker"]) {
749
+ fill: CanvasText;
750
+ stroke: Canvas;
751
+ }
752
+
753
+ :where([data-kit="chart-point"][data-open="true"], [data-kit="chart-glyph-marker"][data-open="true"]) {
754
+ fill: none;
755
+ stroke: CanvasText;
756
+ }
757
+
758
+ :where([data-kit="chart-area"], [data-kit="chart-glyph-area"]) {
759
+ fill: CanvasText;
760
+ fill-opacity: 0.25;
761
+ }
762
+
763
+ :where([data-kit="chart-line"], [data-kit="chart-glyph-line"], [data-kit="chart-stem"]) {
764
+ stroke: CanvasText;
765
+ }
766
+
767
+ :where([data-kit="chart-cell"]) {
768
+ fill: Canvas;
769
+ stroke: CanvasText;
770
+ }
771
+
772
+ :where([data-kit="chart-arc"][data-role="track"]) {
773
+ fill: GrayText;
774
+ }
775
+
776
+ :where([data-kit="chart-pattern-line"]) {
777
+ stroke: Canvas;
778
+ }
779
+
780
+ :where([data-kit="chart-pattern-dot"]) {
781
+ fill: Canvas;
782
+ }
783
+
784
+ :where([data-kit="chart-axis-line"], [data-kit="chart-tick-mark"], [data-kit="chart-grid"], [data-kit="chart-connector"], [data-kit="chart-annotation-line"]) {
785
+ stroke: CanvasText;
786
+ }
787
+
788
+ :where([data-kit="chart-grid"]) {
789
+ stroke: GrayText;
790
+ }
791
+
792
+ :where([data-kit="chart-annotation-band"]) {
793
+ fill: GrayText;
794
+ }
795
+
796
+ :where([data-kit="chart-tick-label"], [data-kit="chart-axis-title"], [data-kit="chart-label"]) {
797
+ fill: CanvasText;
798
+ }
799
+
800
+ :where([data-kit="chart-label"]) {
801
+ stroke: Canvas;
802
+ }
803
+
804
+ :where([data-kit="chart-svg"] [data-active="true"], [data-kit="chart-svg"] [data-breach="true"]) {
805
+ stroke: Highlight;
806
+ }
807
+
808
+ :where([data-kit="chart-focus"]) {
809
+ stroke: Highlight;
810
+ }
811
+
812
+ :where([data-kit="chart-tooltip"]) {
813
+ border-color: CanvasText;
814
+ background-color: Canvas;
815
+ color: CanvasText;
816
+ }
817
+
818
+ :where([data-kit="chart-legend-button"][data-hidden="true"]) {
819
+ color: GrayText;
820
+ }
821
+ }