Baseleg Docs

Design tokens

Design tokens are the single source of truth for visual decisions in Baseleg. All product UI must use these tokens rather than hardcoded values. Tokens are implemented via Tailwind’s configuration and the @baseleg/ui package.

Colour

Neutrals (slate)

The base neutral palette. Used for text, borders, backgrounds, and surfaces.

TokenHexUsage
slate-50#f8fafcPage background, subtle fills
slate-100#f1f5f9Hovered surface backgrounds
slate-200#e2e8f0Borders, dividers
slate-300#cbd5e1Disabled borders
slate-400#94a3b8Placeholder text
slate-500#64748bSecondary / helper text
slate-600#475569Body text (secondary)
slate-700#334155Body text (primary)
slate-900#0f172aHeadings, strong labels
white#ffffffCard surfaces, inputs

Primary (sky)

Used for interactive elements, focus rings, and selected states.

TokenUsage
sky-500Primary action colour
sky-600Primary hover state
sky-50Info badge background
sky-700Info badge text

Semantic colours

ColourTokensUsage
Successgreen-50, green-700, green-200Success states, confirmed badges
Warningamber-50, amber-700, amber-200Warning states, approaching-expiry alerts
Error / Destructiverose-50, rose-800, rose-200, rose-900Error states, destructive actions, lapsed alerts
Infosky-50, sky-700Informational badges

Usage rules

  • Do not hardcode hex values in component or page code.
  • Use semantic colour tokens for their intended meaning — do not use rose for decoration.
  • Focus rings must use sky-500/30 (with opacity) for all interactive elements.

Spacing

Baseleg uses Tailwind’s default spacing scale. Key values:

ScalerempxCommon usage
10.25rem4pxFine spacing, icon gaps
20.5rem8pxInternal padding (tight)
30.75rem12pxInput padding, button padding
41rem16pxStandard component gap
61.5rem24pxSection padding
82rem32pxPage section gaps
123rem48pxMajor layout gaps

Avoid fractional spacing values (e.g. p-2.5) unless explicitly needed for alignment with a specific element.


Typography

All text uses the system font stack via Tailwind’s default configuration unless overridden by a specific token.

ScaleClassUsage
Displaytext-2xl font-boldPage titles
Headingtext-lg font-semiboldSection headings
Subheadingtext-base font-semiboldCard titles, group labels
Bodytext-sm text-slate-700General body text
Secondarytext-sm text-slate-500Helper text, captions
Labeltext-xs font-medium text-slate-600Form labels
Microtext-xs text-slate-400Timestamps, metadata

Border radius

TokenValueUsage
rounded-md6pxInputs, buttons
rounded-lg8pxCards, panels
rounded-xl12pxFeature cards, modals
rounded-full9999pxBadges, avatars, pill tags

Shadows

TokenUsage
shadow-smSubtle card lift
shadowDefault card shadow
shadow-mdDropdown menus, popovers
shadow-lgModals, dialogs

Avoid shadow-xl and above unless displaying a modal-like overlay that needs maximum separation from the page.


Focus rings

All interactive elements must show a visible focus ring for keyboard accessibility:

class="focus:outline-none focus:ring-2 focus:ring-sky-500/30"

Do not remove focus rings without providing an equivalent accessible alternative.