-
Notifications
You must be signed in to change notification settings - Fork 0
UI Component Library & Styles
Relevant source files
- package-lock.json
- package.json
- src-tauri/src/domain.rs
- src/lib/Combobox.svelte
- src/lib/DomainPicker.svelte
- src/lib/combobox.test.ts
- src/lib/combobox.ts
- src/lib/highlight.test.ts
- src/lib/highlight.ts
- src/lib/labels.test.ts
- src/lib/labels.ts
- src/lib/markdown.test.ts
- src/lib/markdown.ts
- src/lib/portal.ts
- src/lib/styles/CONVENTIONS.md
- src/lib/styles/components/button.css
- src/lib/styles/components/chip.css
- src/lib/styles/components/combobox.css
- src/lib/styles/components/feedback.css
- src/lib/styles/components/modal.css
- src/lib/styles/components/monogram.css
- src/lib/styles/components/panel.css
- src/lib/styles/components/tabs.css
- src/lib/styles/elements.css
- src/lib/styles/layout/companies.css
- src/lib/styles/layout/create-form.css
- src/lib/styles/tokens.css
This section covers the Lodestar UI system, which is built on Svelte 5 and a "Vesper" design language. The system emphasizes a warm, editorial aesthetic using serif typography and a structured CSS architecture that separates design tokens, element defaults, and component-specific styles.
The visual identity of Lodestar is centralized in src/lib/styles/tokens.css. The "Vesper" theme is characterized by:
- Typography:
Bodoni Modafor headings andLorafor prose, withSpline Sansreserved for UI controls src/lib/styles/tokens.css#50-52 - Color System: A two-color brand system consisting of a
primaryaubergine (#7d2348) and anaccentgold (#b58320) src/lib/styles/tokens.css#29-35 - Geometry: High-contrast, "squared-off" edges with zero-radius corners (
--r-md: 0) to maintain a crisp, professional look src/lib/styles/tokens.css#78-82
Global defaults for standard HTML elements are defined in src/lib/styles/elements.css. This ensures that all h1, h2, and form inputs share a baseline style without needing per-component overrides src/lib/styles/elements.css#1-4
| Token Category | Usage | Example Variable |
|---|---|---|
| Surfaces | Main background and card colors |
--bg, --card
|
| Text | Hierarchical ink colors |
--ink, --muted, --faint
|
| Semantic | Success, Warning, and Danger states |
--good, --warn, --danger
|
| Space | T-shirt scale for padding/margins |
--sp-1 to --sp-6
|
Sources:src/lib/styles/tokens.css#1-107src/lib/styles/elements.css#1-48
The Combobox.svelte component is a keyboard-accessible, searchable dropdown. It supports fuzzy matching against both labels and aliases (e.g., searching "AI" matches "Artificial Intelligence") src/lib/combobox.ts#1-20
- Implementation: Uses Svelte 5
$stateand$derivedrunes for reactive filtering src/lib/Combobox.svelte#25-70 - Portaling: The dropdown menu is portaled to the
document.bodyusing theportalaction to avoid overflow clipping issues src/lib/Combobox.svelte#222-225src/lib/portal.ts#1-10 - Highlighting: Search matches are visually highlighted using the
segmentsutility src/lib/highlight.ts#1-15
A specialized wrapper around the Combobox for managing a list of domain slugs. It renders selected domains as removable chips and filters the available options to exclude already-selected items src/lib/DomainPicker.svelte#8-13
Shared component styles are modularized in src/lib/styles/components/:
- Chips:
.chipand.chip--countfor status and counts src/lib/styles/components/chip.css - Buttons: Standardized
.btnstyles including primary and flat variants src/lib/styles/components/button.css - Monogram: The
monogramutility inlabels.tsgenerates 2-character fallbacks for logos src/lib/labels.ts#48-51 styled bymonogram.css.
Sources:src/lib/Combobox.svelte#1-225src/lib/DomainPicker.svelte#1-39src/lib/combobox.ts#1-20src/lib/highlight.ts#1-15src/lib/labels.ts#48-51
The labels.ts library provides display-only transformations for raw data. It includes a lookup for common industry acronyms (SaaS, API, AI) to ensure they are capitalized correctly src/lib/labels.ts#1-21
Lodestar uses marked for Markdown parsing and dompurify for sanitization. This is critical for rendering LLM-generated content or user notes safely src/lib/markdown.ts#4-16
-
renderMarkdown(md): Standard sanitized HTML output. -
renderNotes(md): Specifically strips the redundant## Notesheader often found in vault files src/lib/markdown.ts#21-24
- Portal: A Svelte action (
use:portal) that moves an element to a target container (defaulting tobody) while maintaining Svelte's lifecycle src/lib/portal.ts#1-10 - Highlight: A utility that splits a string into segments of
textandmark: booleanfor rendering<mark>tags around search hits src/lib/highlight.ts#5-15
Sources:src/lib/labels.ts#1-51src/lib/markdown.ts#1-25src/lib/highlight.ts#1-15src/lib/portal.ts#1-10
The following diagram illustrates how the DomainPicker coordinates between the global domainsStore and the generic Combobox component.
flowchart LR
subgraph subGraph2 ["Utility Space"]
HL["highlight.ts"]
LB["labels.ts"]
end
subgraph subGraph1 ["Component Space"]
DP["DomainPicker.svelte"]
CB["Combobox.svelte"]
end
subgraph subGraph0 ["Svelte State Space"]
DS["domainsStore (Svelte Store)"]
PICK["pick (Local State)"]
VAL["value (Bindable Prop)"]
end
DS --> DP
DP --> CB
CB --> DP
DP --> VAL
CB --> HL
DP --> LB
Sources:src/lib/DomainPicker.svelte#3-13src/lib/Combobox.svelte#6-22src/lib/highlight.ts#1-5
Lodestar follows a modified BEM (Block Element Modifier) convention for layout styles to prevent leakage between surfaces.
flowchart LR
subgraph subGraph2 ["Layout Scope (companies.css)"]
C_BLK[".companies"]
C_HDR[".companies__header"]
C_LST[".companies__list"]
C_ROW[".company-row__name"]
end
subgraph subGraph1 ["Component Scope (combobox.css / chip.css)"]
CBX[".cbx"]
CHP[".chip"]
end
subgraph subGraph0 ["Global Scope (elements.css / tokens.css)"]
T["--primary"]
H1["h1"]
IN["input#91;type='text'#93;"]
end
T -.-> CBX
H1 -.-> C_BLK
IN -.-> C_HDR
CBX -.-> C_HDR
CHP -.-> C_LST
Sources:src/lib/styles/layout/companies.css#1-15src/lib/styles/elements.css#1-11src/lib/styles/components/combobox.css#10-15
The labels.ts utility handles temporal and textual humanization.
| Function | Input | Output |
|---|---|---|
humanize |
"series_c_plus" |
"Series C+" |
relativeDate |
"2026-06-10", "2026-06-15" |
"5d ago" |
monogram |
"Stripe" |
"St" |