|
| 1 | +# CSS Customization Plan — sol-menu, sol-query, sol-include |
| 2 | + |
| 3 | +Goal: every "magic value" in these three stylesheets resolves to `var(--token, fallback)` so a host page can theme without forking CSS. |
| 4 | + |
| 5 | +## 0. Fonts (DONE) |
| 6 | + |
| 7 | +- `--small-font: 16px; --medium-font: 20px; --large-font: 24px;` |
| 8 | +- `--font-size: var(--medium-font, 20px)` is the default base. |
| 9 | +- `:host` of each component declares `font-size` so the chain works in shadow scope. |
| 10 | +- No size resolves below 16px (the lone offender, `th::after` at .75em → 15px, now uses `--small-font`). |
| 11 | + |
| 12 | +## 1. Spacing, sizing, radius tokens |
| 13 | + |
| 14 | +Add to `root.css`: |
| 15 | +```css |
| 16 | +--space-xs: 2px; |
| 17 | +--space-sm: 4px; |
| 18 | +--space-md: 8px; |
| 19 | +--space-lg: 12px; |
| 20 | +--space-xl: 16px; |
| 21 | +--space-2xl: 24px; |
| 22 | +--radius-sm: 4px; |
| 23 | +--radius-md: 6px; |
| 24 | +``` |
| 25 | + |
| 26 | +Component-specific size knobs: |
| 27 | +- sol-menu: `--menu-nav-min-width: 140px; --menu-nav-max-width: 260px; --menu-popup-min-width: 160px;` |
| 28 | +- sol-query: `--bnode-modal-max-width: min(90vw, 700px); --bnode-modal-max-height: 80vh;` |
| 29 | + |
| 30 | +Sweep raw `px` paddings/gaps/radii in the three component stylesheets and route them through these vars. |
| 31 | + |
| 32 | +## 2. Colors / shadows / scrim |
| 33 | + |
| 34 | +`root.css` already declares `--shadow`. Sweep remaining hex / rgba: |
| 35 | +- sol-menu popup `box-shadow: 0 4px 12px rgba(0,0,0,0.12)` → `var(--shadow-popup, 0 4px 12px rgba(0,0,0,0.12))`. |
| 36 | +- sol-query bnode modal `0 8px 24px var(--shadow, rgba(0,0,0,0.25))` → `var(--shadow-modal, 0 8px 24px rgba(0,0,0,0.25))`. |
| 37 | +- sol-query backdrop `rgba(0,0,0,0.4)` → `var(--scrim, rgba(0,0,0,0.4))`. |
| 38 | +- Audit anchor / link colors — already use `--accent`; nothing to change unless we want a `--link` alias. |
| 39 | + |
| 40 | +## 3. Font-weight & line-height tokens |
| 41 | + |
| 42 | +```css |
| 43 | +--font-weight-normal: 400; |
| 44 | +--font-weight-bold: 600; |
| 45 | +--line-height-tight: 1.25; |
| 46 | +--line-height-base: 1.5; |
| 47 | +``` |
| 48 | + |
| 49 | +Replace literal `600` (sol-menu group/active, sol-query th/dt/.subject-heading/.dl-field) and the `1.25` line-height in sol-include headings. |
| 50 | + |
| 51 | +## 4. Per-component theming knobs |
| 52 | + |
| 53 | +Prefix-scoped vars so a page can target one component without leaking to others. |
| 54 | + |
| 55 | +sol-menu: |
| 56 | +- `--menu-button-padding`, `--menu-button-radius`, `--menu-active-bg`, `--menu-active-color`, `--menu-hover-bg`, `--menu-hover-color`. |
| 57 | + |
| 58 | +sol-query: |
| 59 | +- `--query-th-bg` (alias of existing `--th-color`), `--query-th-color` (alias of `--th-text-color`), `--query-row-alt-bg` (alias of `--even-color`), `--query-link-color`, `--query-bnode-link-color`, `--query-cell-padding`. |
| 60 | + |
| 61 | +sol-include: |
| 62 | +- `--include-code-bg`, `--include-code-padding`, `--include-blockquote-border`, `--include-blockquote-color`. |
| 63 | + |
| 64 | +These layer on top of the global tokens — global vars stay the source of truth, prefix vars allow narrow overrides. |
| 65 | + |
| 66 | +## 5. Cleanup / audit |
| 67 | + |
| 68 | +- `root.css` declares `--text-muted` twice (lines 6 & 7); drop the first. |
| 69 | +- Decide whether `[data-theme="dark"]` should redefine the new font / spacing scales (probably not, but document). |
| 70 | +- Verify nothing else in the three stylesheets resolves below 16px after the spacing pass. |
| 71 | +- After each step: `npm run bundle` and spot-check in browser. |
0 commit comments