Skip to content

Design System

The portal’s design system uses a CSS custom properties approach with an atomic component hierarchy. All visual styling flows from a single token layer.

Token layer (@ltg/ui-tokens)

Defines all CSS variables. The active theme overrides these at :root.

Core brand tokens

--navy: #0e1d33 /* Primary brand colour */
--navy-dark: #00091f /* Deeper navy for backgrounds */
--navy-mid: #28374d /* Mid-tone for borders and hover */
--navy-light: #9aa9bf /* Light navy for subtle elements */
--gold: #c6873b /* Accent / CTA colour */
--gold-light: #fffaae /* Light gold for highlights */
--gold-hover: #ad6e22 /* Gold on hover */

Semantic tokens

--bg: #faf8f5 /* Page background */
--surface: #ffffff /* Card / panel background */
--surface2: #f5f0eb /* Secondary surface */
--border: #d6cfc6 /* Primary border */
--border2: #c2bbb2 /* Stronger border */
--text: #0e1d33 /* Primary text */
--text2: #2d3c52 /* Secondary text */
--muted: #6b7a8d /* Muted / placeholder text */
--green: #22c55e /* Success */
--green-light: rgba(34,197,94,0.12)
--red: #ef4444 /* Danger / error */
--red-light: rgba(239,68,68,0.12)
--amber: #f59e0b /* Warning */
--amber-light: rgba(245,158,11,0.12)
--blue: #06b6d4 /* Info */
--blue-light: rgba(6,182,212,0.12)

Typography

--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif
--mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace

Theme presets

Eight built-in presets, each overriding the token set:

Preset ID Navy Gold
lockstep #0e1d33 #c6873b
forest #1a3d2b #7ab648
ocean #0a2540 #00b4d8
midnight #0d0d1a #5865f2
enterprise #1c1c2e #a0a0b0
slate #1e293b #14b8a6
crimson #2d0a0a #e07070
rose #2d1b1b #e8b4a0

Applying a preset

import { applyPreset } from '@ltg/theme-engine';
applyPreset('ocean'); // Updates :root CSS vars immediately

Custom colour overrides

import { applyTheme } from '@ltg/theme-engine';
applyTheme({
presetId: 'lockstep',
overrides: {
colors: {
'--gold': '#d4a055',
'--navy': '#112244',
}
}
});

Component packages

@ltg/ui-atoms

Base building blocks:

  • Button — variants: primary, secondary, outline, ghost, danger
  • Badge — colour variants matching semantic tokens
  • MethodBadge — HTTP method pill (GET=green, POST=gold, PUT=blue, PATCH=purple, DELETE=red)
  • Spinner — loading indicator
  • Logo — LTG logo with optional size prop

@ltg/ui-molecules

Composed components:

  • SearchBar — debounced input with icon
  • ThemePresetCard — clickable preset swatch
  • ColorPickerField — colour input with live preview
  • CopyButton — copies text to clipboard with feedback

@ltg/ui-organisms

Complex sections:

  • ThemeSettings — full theme editor panel (presets + custom colours)
  • PortalHeader — top bar with logo, breadcrumb, settings button
  • DataTable — sortable table with loading state

@ltg/openapi-renderer

Wraps @scalar/api-reference-react. Injects CSS to map LTG tokens → Scalar’s CSS variables, so the API docs always match the active portal theme.

import { OpenAPIRenderer } from '@ltg/openapi-renderer';
<OpenAPIRenderer
specUrl="/api/specs/my-api.json"
proxyUrl="/api/proxy"
/>

Using tokens in custom pages

In Astro pages, reference tokens directly in inline styles or a <style> block:

<div class="my-card">Hello</div>
<style>
.my-card {
background: var(--surface);
border: 1px solid var(--border);
color: var(--text);
border-radius: 8px;
padding: 1rem;
}
.my-card:hover {
border-color: var(--navy-mid);
}
</style>

Theme switches update all var() references live — no re-render needed.