CSS styling system for guitar-app. USE FOR: adding new UI elements, changing colors/themes, understanding visual conventions, fixing styling bugs, adding dark/light/print mode support. Covers CSS custom properties, scoped Svelte styles, global app.css structure, naming conventions, component patterns (buttons, cards, forms, tags), font stack, transitions, SVG coloring via CSS vars.
<style> blocks (Svelte auto-scopes class selectors)'Work Sans' from Google Fonts, fallback system-ui, -apple-system, sans-serif — loaded in index.htmlAll variables defined on :root in src/app.css. Dark theme is default; light/print override via media queries.
Backgrounds & Surfaces:
| Variable | Value | Usage |
|---|---|---|
--bg | #000000 | Main background |
--bg-secondary | #0d0d0d | Secondary background |
--bg-card | #161616 | Card/surface background |
--border | #262626 | Border color |
Text:
| Variable | Value | Usage |
|---|---|---|
--text | #e8e8e8 | Primary text |
--text-muted | #808080 | Muted/disabled text |
Accents & Status:
| Variable | Value | Usage |
|---|---|---|
--accent | #d4874d | Primary accent (warm orange) |
--accent-hover | #e09960 | Accent hover state |
--error | #d44040 | Error (red) |
--success | #5a9a5a | Success (green) |
--highlight | #d4874d | Highlight (same as accent) |
Fretboard-Specific:
| Variable | Value | Usage |
|---|---|---|
--fretboard-bg | #2c1810 | Fretboard background (dark brown) |
--fret-color | #a0a0a0 | Fret lines (gray) |
--string-color | #d4a574 | Guitar strings (tan) |
--dot-bg | #d4874d | Finger dot background |
--dot-text | #000000 | Finger dot text |
--root-bg | #cc4444 | Root note (red) |
--nut-color | #f5f0e8 | Guitar nut (cream) |
Overlays (Transparency):
| Variable | Value |
|---|---|
--overlay-faint | rgba(255,255,255,0.06) |
--overlay-subtle | rgba(255,255,255,0.15) |
--overlay-medium | rgba(255,255,255,0.5) |
Tag Colors (Shape/Type Indicators): Each tag has 3 vars: color, background, border.
| Tag | Color | Usage |
|---|---|---|
--tag-caged / -bg / -border | #6bb3a0 (teal) | CAGED shape tags |
--tag-pos / -bg / -border | #d4874d (orange) | Position tags |
--tag-barre / -bg / -border | #b89aaa (mauve) | Barre tags |
--tag-other / -bg / -border | #a0a090 (tan-gray) | Other tags |
Activated via @media (prefers-color-scheme: light) in src/app.css.
No manual toggle — follows OS/browser preference.
All variables redefined with warm browns for accents, lighter backgrounds (e.g., --fretboard-bg: #e8d5b7).
@media print overrides in src/app.css:
.no-print class hides interactive elementsBEM-like (simplified, no __ or -- modifiers):
.btn, .chord-grid, .chord-card, .control-group, .tab-bar.btn-primary, .btn-secondary, .btn-small.active, .disabled, .in-pool, .filled, .moving, .selected.tablet, .mobile-*.page-root, .scroll-area, .no-print.btn {
padding: 8px 16px;
background: var(--accent);
color: var(--bg);
border: none;
border-radius: 6px;
font-weight: 600;
cursor: pointer;
transition: background 0.2s;
}
.chord-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px;
}
select, input[type="text"] {
padding: 8px 12px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 6px;
color: var(--text);
font-size: 16px; /* minimum 16px — prevents iOS Safari auto-zoom on focus */
}
transition: all 0.2s or transition: color 0.15sFretboard and chord diagrams use CSS variables directly in SVG attributes:
<line stroke="var(--fret-color)" />
<circle fill="var(--dot-bg)" />
| Lines | Section |
|---|---|
| 1-36 | :root CSS variables (dark theme) |
| 38-58 | Custom CSS reset (box-sizing, margin, font) |
| 60-370 | Global element styles, buttons, controls, containers, grids |
| 370-407 | @media (prefers-color-scheme: light) overrides |
| 409-470 | @media (max-width: 768px) responsive |
| 472-525 | @media print overrides |
<style> — global styles only in app.cssmin-width set to accommodate the longest label, plus justify-content: center. This prevents layout shift when the text toggles. Example: .voicing-action-btn { min-width: 105px; justify-content: center; }margin-right: calc(-1 * var(--scroll-extend)); padding-right: calc(var(--scroll-extend) + Npx). Their ancestor chain must use overflow-y: clip; overflow-x: visible (not overflow: hidden). See the layout skill for the full architecture.