Docs / Guides
Design system
OpenFini's interface is built on Shoelace 2.20 — a prebuilt, accessible, framework-agnostic web-component library (MIT) — plus a small token layer that gives it the dense, tool-like look creative applications need.
Why Shoelace#
- Prebuilt and complete: color picker, range, select, switch, dropdown/menu (with submenus), dialog, alert/toast, tooltip, icon — exactly the primitives a studio UI needs, with keyboard support and ARIA.
- No framework, no build step: custom elements work with the plain DOM code OpenFini uses.
- Light: components are loaded on demand by the autoloader. A typical session fetches 90-ish small files (~0.5 MB uncompressed) instead of a monolithic bundle; the rest of the library is never downloaded.
- Themable with CSS custom properties, including dark and light themes.
Everything dense or canvas-specific (scrubbable number fields, curve and gradient editors, the layer tree,
tool buttons) is lightweight DOM in app/src/ui/controls.js — Shoelace
components are used wherever they fit, not forced where they would be heavy.
Tokens#
Design tokens live in app/styles/theme.css as CSS custom properties.
| Token | Dark | Light | Used for |
|---|---|---|---|
--of-bg-app | #1d1e22 | #e9eaee | window background |
--of-bg-bar | #25262b | #f6f6f8 | header, toolbars, status bar |
--of-bg-panel | #2a2b31 | #f1f1f4 | dock panels |
--of-bg-canvas | #141518 | #cfd1d8 | pasteboard around the pages |
--of-border / --of-border-soft | #3a3b43 / #2f3037 | #d2d3da / #dfe0e6 | separators and field borders |
--of-text / --of-text-dim / --of-text-faint | #e8e9ee / #a3a5ae / #6f717b | #1c1d22 / #5d5f69 / #8b8d97 | text hierarchy |
--of-accent | #8b7cf6 | #6b58e8 | selection, focus, active controls |
--of-radius, --of-radius-sm | 6px, 4px | corners |
Shoelace's own tokens are mapped onto these (input height 24 / 28 px, 12 px type, accent as the primary color, tooltip and panel colors), so every Shoelace component picks up the same look.
Theming#
Color themes are registered in app/src/ui/themes.js and written to <html> as the --of-* variables
above (plus --of-on-accent, --of-selection, the editor and syntax variables); see Themes. The table values are the default
theme; never hard-code a color in a component, use a variable. Text on the accent uses --of-on-accent. Scrollbars
(app/styles/themes.css) use --of-scroll-*; add .of-native-scroll to keep a platform scrollbar.
The mode is a class on <html>: sl-theme-dark or sl-theme-light (both Shoelace theme sheets are
loaded). Preferences ▸ Theme offers Dark, Light and Match system. The canvas pasteboard, rulers
and overlays read the same tokens, so they follow the theme automatically.
Typography#
Inter (variable, OFL) is bundled (app/vendor/fonts, Latin subset, ~100 KB) so the interface and the
default document font look identical on every platform. Documents may use any installed or user-supplied
font.
Density and layout#
- 4 px spacing grid, 26-28 px controls, 36 px tool buttons, 304 px dock.
- The workspace is a CSS grid: header · document tabs · context bar · toolbox | canvas | dock · status bar. Below 960 px the dock becomes a slide-over drawer and the studio buttons collapse to icons; below 640 px the menu bar is hidden (use the app on tablets in landscape for real work).
- Pointer-first interaction with full keyboard coverage (see Studios guide);
prefers-reduced-motiondisables transitions.
Icons#
Two libraries, both rendered by <sl-icon>:
| Library | Source | Notes |
|---|---|---|
| default | Bootstrap Icons (MIT) as shipped by Shoelace | Only the icons the app uses are vendored (~150 of ~2,000): node scripts/vendor-icons.mjs <path> rescans the sources. |
of | OpenFini's own glyphs in app/assets/icons | Studio marks, selection / retouch tool glyphs, node-editing icons, alignment and gradient icons. Generated by scripts/make-ui-icons.mjs on a 16 px grid using currentColor. |
Accessibility#
Shoelace components provide roles, focus handling and keyboard operation. OpenFini adds labels to every
icon-only button (aria-label plus a tooltip with the shortcut), role="tree" / treeitem for the layer
list, aria-pressed on toggle groups, visible focus rings, and respects the system theme and reduced-motion
settings. The canvas itself is a pointer-driven surface; full keyboard drawing is on the roadmap.
Edit on GitHub → docs/design-system.md