SPB Git

Repository Public

blocks-a.css 6.8 KB 66 lines css

1/*2 * file: src/components/editor/nodes/blocks-a.css3 * description: styles of the drawing block (`dr-*`: preview, ink editor sheet) and of the chart block (`ch-*`: SVG figure, legend, data4 *   grid). Chrome uses the design tokens of globals.css; the only literal colours are the chart's categorical series palette (eight5 *   hues in a fixed order, one step per theme, chosen to stay distinguishable for colour-blind readers on each surface).6 * author: Simon-Pierre Boucher — contact@spboucher.ai7 */89/* ---------- drawing ---------- */10.note-editor .dr-preview { display: block; max-width: 100%; height: auto; margin-inline: auto; user-select: none; -webkit-user-drag: none; }11.dr-editor { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }12.dr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }13.dr-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }14.dr-swatch { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: var(--r-pill); border: 2px solid transparent; }15.dr-swatch > span { display: block; width: 1.125rem; height: 1.125rem; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--fg) 18%, transparent); }16.dr-swatch[aria-pressed="true"] { border-color: var(--accent); }17.dr-swatch:disabled { opacity: .35; cursor: not-allowed; }18.dr-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }19.dr-dot { display: block; border-radius: var(--r-pill); background: currentColor; }20.dr-stage { display: flex; justify-content: center; min-width: 0; width: 100%; }21.dr-canvas { display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: crosshair; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); max-width: 100%; }22.dr-canvas[data-tool="eraser"] { cursor: cell; }23.dr-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; padding-top: .25rem; }24@media (pointer: coarse) { .dr-swatch { width: 2.5rem; height: 2.5rem; } .dr-swatch > span { width: 1.5rem; height: 1.5rem; } }2526/* ---------- chart ---------- */27.ch, .ch-root {28  --ch-1: #2a78d6; --ch-2: #eb6834; --ch-3: #1baf7a; --ch-4: #eda100; --ch-5: #e87ba4; --ch-6: #008300; --ch-7: #6250d6; --ch-8: #e34948;29}30.dark .ch, .dark .ch-root {31  --ch-1: #3987e5; --ch-2: #d95926; --ch-3: #199e70; --ch-4: #c98500; --ch-5: #d55181; --ch-6: #0ca30c; --ch-7: #9085e9; --ch-8: #e66767;32}33.note-editor .ch-title { display: block; width: 100%; min-width: 0; height: 1.75rem; border: 0; border-radius: var(--r-xs); background: transparent; padding: 0 .25rem; font: inherit; font-weight: 500; color: var(--fg); outline: none; user-select: text; -webkit-user-select: text; cursor: text; text-overflow: ellipsis; }34.note-editor .ch-title::placeholder { color: var(--fg-faint); font-weight: 400; }35.note-editor .ch-title:hover, .note-editor .ch-title:focus { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }36.ch-figure { min-width: 0; max-width: 100%; overflow: hidden; padding: .75rem .75rem .5rem; }37.ch-svg { display: block; width: 100%; height: auto; max-width: 100%; overflow: visible; }38.ch-gridline { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }39.ch-axis { stroke: var(--line-strong, var(--fg-faint)); stroke-width: 1; shape-rendering: crispEdges; }40.ch-tick { fill: var(--fg-muted); font-size: 11px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }41.ch-dot { stroke: var(--bg-elev); stroke-width: 1.5; }42.ch-slice { stroke: var(--bg-elev); stroke-width: 2; stroke-linejoin: round; }43.ch-mark:hover, .ch-dot:hover, .ch-slice:hover { filter: brightness(1.12); }44.ch-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1rem; margin: .5rem 0 0; padding: 0; list-style: none; font-size: 0.75rem; line-height: 1.125rem; color: var(--fg-muted); }45.ch-legend li { display: inline-flex; align-items: center; gap: .375rem; min-width: 0; max-width: 100%; margin: 0; padding: 0; } .ch-legend li::before { content: none; }46.ch-legend li > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }47.ch-swatch { display: inline-block; flex-shrink: 0; width: .625rem; height: .625rem; border-radius: 2px; }48.ch-notes { margin: .375rem 0 0; padding: 0; list-style: none; font-size: 0.6875rem; line-height: 1rem; color: var(--fg-faint); text-align: center; } .ch-notes li { margin: 0; padding: 0; } .ch-notes li::before { content: none; }49.ch-note { display: flex; align-items: center; gap: .375rem; padding: .375rem .75rem; border-bottom: 1px solid var(--line); background: var(--bg-sunk); font-size: 0.75rem; line-height: 1.125rem; color: var(--fg-muted); }50.ch-note svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--fg-faint); } .ch-note span { min-width: 0; overflow-wrap: anywhere; }51.ch-edit { border-top: 1px solid var(--line); }52.ch-map { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .375rem; min-width: 0; max-width: 100%; } .ch-map select { max-width: 11rem; }53.ch-chip { display: inline-flex; align-items: center; gap: .375rem; height: 1.75rem; max-width: 100%; padding: 0 .5rem; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--bg); font-size: 0.75rem; color: var(--fg-muted); white-space: nowrap; }54.ch-chip[aria-pressed="true"] { border-color: color-mix(in oklab, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--fg); }55.ch-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }56.note-editor table.ch-grid, .ch-grid { width: max-content; min-width: 0; margin: 0; border-collapse: separate; border-spacing: 0; table-layout: auto; font-size: 0.8125rem; }57.note-editor .ch-grid th, .note-editor .ch-grid td, .ch-grid th, .ch-grid td { padding: 2px; border: 0; background: transparent; text-align: left; vertical-align: middle; font-weight: 400; min-width: 0; }58.ch-grid .ch-num { padding: 0 .375rem 0 .625rem; color: var(--fg-faint); font-size: 0.6875rem; font-variant-numeric: tabular-nums; text-align: right; user-select: none; }59.ch-th { display: flex; align-items: center; gap: 2px; }60.ch-cell { width: 7.5rem; } .ch-cell-num { text-align: right; font-variant-numeric: tabular-nums; }61.ch-name { width: 5.5rem; flex: 1; font-weight: 600; background: var(--bg-sunk); }62.ch-gridfoot { border-bottom: 0; border-top: 1px solid var(--line); }63.ch-paste { border-top: 1px solid var(--line); } .ch-paste .nb-code { min-height: 6.5rem; white-space: pre; }64.ch-paste-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; padding: .5rem .75rem; }65@media (pointer: coarse) { .ch-chip { height: 2.25rem; padding: 0 .75rem; } .ch-cell { height: 2.5rem; font-size: 1rem; } .note-editor .ch-title { height: 2.25rem; font-size: 1rem; } .ch-map select { height: 2.5rem; font-size: 1rem; } }66
Files main
Menu

Theme