Design System
Bilko Design System Documentation
Project:Source:{{PROJECT_NAME}}Extracted fromapps/web/tailwind.config.ts+ brand identity specVersion:Design Language:{{VERSION}}ModernDate:Balkan{{DATE}}accountingAuthor:SaaS{{AUTHOR}}—Status:clean,Draftprofessional,| In Review | ApprovedReviewers:{{REVIEWERS}}accessible
Document History
1.Color Design PrinciplesPalette
Primary
2. Color System
2.1 Primitive Palette (Raw Values)Colors
/*Primary: Brand#00E5A0 primitives(Vibrant teal-green — doprimary NOTCTA, uselinks, directlyactive instates)
componentsPrimary */Dark: --color-brand-50:#00B380 {{#F0F9FF}};(Darker --color-brand-100:variant {{#E0F2FE}};for --color-brand-500:hover {{#0EA5E9}};states)
--color-brand-600:Primary {{#0284C7}};Light: --color-brand-900:#33EBB3 {{#0C4A6E}};(Lighter --color-neutral-0:variant #FFFFFF;for --color-neutral-50: {{#F8FAFC}};
--color-neutral-100: {{#F1F5F9}};
--color-neutral-400: {{#94A3B8}};
--color-neutral-700: {{#334155}};
--color-neutral-900: {{#0F172A}};
--color-neutral-1000: #000000;backgrounds)
2.2Status Semantic Tokens (Light Mode)Colors
/*Success: Background#22C55E */(Green --color-bg-primary:— var(--color-neutral-0);success --color-bg-secondary:states, var(--color-neutral-50);paid --color-bg-elevated:invoices, var(--color-neutral-0);positive /*metrics)
TextWarning: */#F59E0B --color-text-primary:(Amber var(--color-neutral-900);— --color-text-secondary:warnings, var(--color-neutral-700);pending --color-text-disabled:items, var(--color-neutral-400);aging --color-text-inverse:invoices)
var(--color-neutral-0);Error: /*#EF4444 Interactive(Red */— --color-interactive-primary:errors, var(--color-brand-500);overdue --color-interactive-primary-hover:invoices, var(--color-brand-600);negative --color-interactive-primary-active:actions)
var(--color-brand-700);Info: /*#3B82F6 Semantic(Blue */— --color-success:informational {{#10B981}};messages, --color-warning:neutral {{#F59E0B}};
--color-error: {{#EF4444}};
--color-info: {{#3B82F6}};data)
2.3Text Semantic Tokens (Dark Mode)Colors
[data-theme="dark"]Text {Primary: --color-bg-primary:#111113 var(--color-neutral-900);(Near-black --color-bg-secondary:— var(--color-neutral-800);body --color-text-primary:text, var(--color-neutral-50);headings)
/*Text TODO:Secondary: Complete#6B7280 dark(Gray-600 mode— tokensecondary mappingtext, */labels)
}Text Muted: #888888 (Gray-500 — muted text, placeholders)
2.4Background ContrastColors
Background Light: #FAFAFA (WCAG)Off-white — main content area background)
Background Surface: #FFFFFF (White — card backgrounds, modals)
Border Color
Chart Colors | Green |||
|---|---|---|---|
Expense: #EF4444 (Red — expense bars/lines)
Chart Profit: #3B82F6 (Blue — profit bars/lines)
Chart Neutral: #6B7280 (Gray — neutral data points)
Sidebar Colors (Dark Theme)
Usage: | background
|||
Source: Google Fonts Inter (variable font) Fallback: System UI fonts for performance Font Sizes | labels)
|||
Font Weights |
Type Scale Usage
- Headings:
- Page title:
text-3xl font-bold(32px, 700) - Section title:
text-2xl font-bold(24px, 700) - Card title:
text-base font-semibold(16px, 600)
- Page title:
- Body:
- Default:
text-base font-normal(16px, 400) - Table cells:
text-sm font-medium(14px, 500) - Muted text:
text-sm text-text-muted(14px, #888888)
- Default:
- Numbers:
- Metrics:
text-3xl font-bold(32px, 700) - Totals:
text-2xl font-bold(24px, 700) - Amounts:
text-base font-medium(16px, 500)
- Metrics:
Spacing System (8px Grid)
xs: 4px (Tight spacing, icon gaps)
sm: 8px (Input padding, small gaps)
md: 16px (Default spacing, card padding)
lg: 24px (Section spacing)
xl: 32px (Large section spacing)
2xl: 48px (Major section breaks)
3xl: 64px (Hero spacing)
TODO:Usage:
- Card padding:
p-6(24px) - Form field gap:
space-y-4(16px) - Section spacing:
space-y-6(24px) - Grid gap:
gap-6(24px)
Consistency: RunAll contrastspacing checksuses with8px 24px, {{axeincrements |(4px, Colour8px, Contrast16px, Analyser}}and32px, fill48px, table.64px)
3.Border TypographyRadius
sm: 3.16px Font(Small Families
elements, badges)
md: 8px Token (Buttons, Value inputs, Usage cards)
lg: 12px (Modals, large --font-headingcards)
full: 9999px (Circular elements, pills)
{{Inter, sans-serif}}
H1–H4, display text
--font-body
{{Inter, sans-serif}}
Body copy, labels, UI
--font-mono
{{JetBrains Mono, monospace}}
Code, technical data
3.2 Type Scale
Token
Size
Weight
Line Height
Letter Spacing
Usage
--text-display
48px
700
1.1
-0.02em
Hero headings
--text-h1
36px
700
1.2
-0.01em
Page titles
--text-h2
28px
600
1.25
-0.01em
Section headings
--text-h3
22px
600
1.3
0
Subsections
--text-h4
18px
600
1.4
0
Card headings
--text-body-lg
18px
400
1.6
0
Lead paragraphs
--text-body
16px
400
1.6
0
Default body copy
--text-body-sm
14px
400
1.5
0
Secondary text, captions
--text-label
14px
500
1.4
0.01em
Form labels, UI labels
--text-caption
12px
400
1.4
0.02em
Timestamps, meta
--text-code
14px
400
1.6
0
Inline code
TODO:Usage:
- Cards:
rounded-md(8px) - Buttons:
rounded-md(8px) - Inputs:
rounded-md(8px) - Badges:
rounded-sm(6px) - User avatar:
rounded-full(circular)
Shadows
Card Shadow: 0 2px 8px rgba(0, 0, 0, 0.08) (Subtle card elevation)
Modal Shadow: 0 8px 24px rgba(0, 0, 0, 0.12) (Dialog/modal elevation)
Dropdown Shadow: 0 4px 16px rgba(0, 0, 0, 0.10) (Dropdown menu elevation)
Usage:
- Cards:
shadow-card - Modals/dialogs:
shadow-modal - Dropdown menus:
shadow-dropdown
Philosophy: VerifySubtle scaleshadows againstfor Figmadepth, —avoid updateheavy valuesshadows if(material mismatched.design style)
4. Spacing & LayoutBreakpoints
sm: 4.640px (Small tablets, large phones)
md: 768px (Tablets)
lg: 1024px (Small desktops, large tablets)
xl: 1280px (Desktops)
Mobile-First Strategy:
- Base styles = mobile (< 640px)
sm:= small tablet (640px+)md:= tablet/desktop toggle (768px+)lg:= desktop layout (1024px+)xl:= wide desktop (1280px+)
Responsive Patterns:
- Grid:
grid-cols-1Spacingmd:grid-cols-2Scalelg:grid-cols-3 - Sidebar:
hidden md:block(4pxhideBaseonUnit)mobile) - Filters:
flex-colTokenValueUsage--space-0sm:flex-row0px--space-14pxMicro gaps, icon padding--space-28pxTight inline spacing--space-312pxCompact form elements--space-416pxDefault content spacing on--space-520px stackCard padding(compact)mobile, row--space-6 on24pxCardtablet+)padding, section padding--space-832pxLarge section gaps--space-1040pxFeature section padding--space-1248pxSection separation--space-1664pxPage-level padding--space-2080pxHero sections
4.2 Grid System
4.3 Responsive Breakpoints
| ||
| ||
| ||
| ||
| ||
|
5. Component LibraryTokens
Button
5.1
Primitive- Height:
Components40px (Atoms)
default), 5.2 Composite Components32px (Molecules)
sm), | ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
5.3 Layout Components
| |
| |
| |
| |
| |
|
6. Iconography Guidelines
Input
Card
Badge
| sm)
|
| |
Table
Icon SystemLibrary: Lucide React (v0.469.0)
Size: Consistent 16px ( Common Icons:
Chart Design TokensChart Colors (Recharts) | no |
Chart Layout
AccessibilityColor Contrast
Focus Indicators
| Primary |
Semantic
|
Accessibility→ rule:h2 Icons→ conveyingh3)
meaning
aria-labelaria-hidden="true"7. Motion & Animation Standards
7.1 Duration Tokens
| ||
| ||
| ||
| ||
|
7.2 Easing Tokens
| | |
| | |
| | |
| |
7.3 Reduced Motion
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
Rule: Every animated component MUST respect prefers-reduced-motion.
8. Accessibility Requirements Per Component
| | | | | |
| | | |||
| | ||||
9. Design Token FormatPrinciples
9.1 CSS Custom Properties (Source of Truth)
/* tokens/colors.css */
:root {
--color-brand-500: #0EA5E9;
/* ... */
}
9.2 Tailwind Config Extension
// tailwind.config.ts
export default {
theme: {
extend: {
colors: {
brand: {
500: 'var(--color-brand-500)',
// ...
}
}
}
}
}
9.3 JavaScript/TypeScript Constants
// tokens/colors.ts — for use in charting libraries, canvas, etc.
export const colors = {
brand500: '#0EA5E9',
// ...
} as const;
Token update process: Figma → Style Dictionary export → CSS/JS/Tailwind files → PR review.
10. Component Documentation Standard
Each component story must include:
DefaultClarity over Decorationstory—basic render withData-first, minimalpropsornamentationAllConsistentVariantsSpacingstory—every8pxvisualgrid,variantpredictabledisplayedrhythmAllAccessibleStatesby Defaultstory—hover,WCAGfocus,AAdisabled,minimum,error,RadixloadingUI primitivesResponsiveMobile-Firststory—behaviorResponsiveatfromeach375px+breakpoint(iPhone SE)AccessibilityDarkstorySidebar + Light Content —keyboardClearnavigation,visualscreenseparation- Primary
notesColor as Accent — Green (#00E5A0) for actions, not backgrounds - Subtle Shadows — Elevation without heaviness
- Data-Dense UI — Tables, charts, metrics — optimized for information density
Brand Identity Alignment
ComponentFrom JSDoc minimum:~/system/specs/bilko-brand-identity.md:
/**
*- Primary
Button component for primary user actions.
*
* @example
* <Button variant="primary" onClick={handleSubmit}>Save Changes</Button>
*/
Props table:Color: Every#00E5A0 prop(implemented)
must
ApprovalFuture Tokens (Phase 2)
| Error | message | backgrounds | |
| States: | Success | message | |
| Notifications: | Background, | ||
| Mode: | Full | dark |