SPB Git

Repository Public License

DESIGN.md 16.7 KB

# Lunar Glass — the ORIX Navigator design system

LunarDesign (Packages/NavigatorKit/Sources/LunarDesign) is the design system of ORIX Navigator on macOS, iOS and iPadOS. Its visual identity is called Lunar Glass: an obsidian window, a floating translucent capsule bar, thin orbital rings, and planets that stand for workspaces. Cosmic but sober; luxurious, legible, recognisable at a glance.

The module depends on SwiftUI and AppKit/UIKit only. It does not import NavigatorCore.

About the original mockups. The concept images from the owner's conversation were not available when this system was built. Nothing here was traced from them. The reference renders in DesignSystem/reference/ are native mockups drawn from the written specification with the real components; they are the visual target for the real screens until the owner confirms or corrects them against the original concepts.

# 1. Principles

  1. The page is the subject. Chrome floats above and around the web content and gets out of its way. The web area is always the dominant surface.
  2. Glass is for chrome and controls only. Never behind the body text of a page, never as a full-window effect.
  3. Depth by layering, not by weight. Hairlines, a top highlight and soft low-opacity shadows. No thick borders, no hard corners, no heavy shadows.
  4. Space, quietly. Orbital rings are one point thin. The starfield is sparse, slow and optional. Colour is used for meaning (accent, workspace tint, status), not decoration.
  5. Themes are data. A view never names a colour: it reads a semantic role from the theme in the environment.
  6. Accessible by construction. Contrast is computed and tested; state never relies on colour alone; every control has a label, a focus ring and a minimum hit target.

# 2. Tokens

Source of truth: Sources/LunarDesign/Tokens/. Exported for other tools as DesignSystem/tokens.json (LunarTokenDocument.current); a test fails if the file drifts from the code.

Token Values
Core palette (LunarPalette) Obsidian #080B15, Midnight #101522, Lunar Slate #171F35, Silver #E6EAFA, Spectral Violet #927ADB, Lunar Blue #9BAEFF, Aurora Mint #75DFC9
Grid 4 pt (LunarSpacing.unit)
Spacing (LunarSpacing) xs 8, sm 12, md 16, lg 24, xl 32
Radii (LunarRadius, LunarShape) xs 10, sm 16, md 22, lg 28, xl 36, plus .capsule and .circle; corners are continuous
Strokes (LunarStroke) hairline 1 (1.5 under Increase Contrast), focus ring 2, orbital ring 1
Metrics (LunarMetrics) touch target 44 (iOS), pointer target 28 (macOS), control height 36 / 28 compact, bar height 44
Elevation (LunarElevation) flat (no shadow), raised (radius 10, y 3), floating (radius 24, y 10); shadow alpha ≤ 0.42 dark, 0.16 light
Type (LunarTextStyle) display, title, title2, headline, body, bodyEmphasized, callout, subheadline, footnote, caption, overline, mono
Motion (LunarMotion) quick 0.18 s, snappy 0.28 s, smooth 0.42 s, gentle 0.62 s spring responses, damping 0.86–1.0

Typography is SF Pro through system text styles (.lunarFont(_:)), so every role follows Dynamic Type; mono is SF Mono. Numbers that update or align use tabular digits (.lunarTabularDigits()). Icons are SF Symbols or the proprietary glyphs below.

Colours are stored as LunarRGBA (plain sRGB numbers, Sendable, Codable, hex parsing, WCAG luminance and contrast). LunarRGBA is a ShapeStyle: pass it straight to foregroundStyle, fill, stroke.

# 3. Themes

Twelve families (LunarThemes.all), each a LunarThemeFamily with a designed dark and a designed light LunarTheme. The light renditions are their own palettes (lunar white fields, silver chrome, deep slate accents), not inversions. The family id is the stable string to persist; never rename a shipped id.

id Name Dark accent Light accent Mood
lunar (default) Lunar #9BAEFF #3D54C8 Obsidian night, silver light, lunar blue
obsidian Obsidian #C9D2F5 #2A3350 Near-black volcanic glass, pale silver
aurora Aurora #75DFC9 #086B5A Polar night, mint and ice blue
eclipse Eclipse #FFB26B #94480A Warm black, amber corona
silver Silver #C4CCDE #4A5570 Graphite and cool metal
nebula Nebula #C58BEF #7B3DB8 Violet dust, magenta light
ocean Ocean #5CB8F0 #0E67A8 Abyssal blue
solar Solar #F4C56A #8A5E00 Dark amber and gold
forest Forest #6CC48A #24703E Moss, pine, night air
rose Rose #F28DB2 #B5306A Dusk pink over plum
monochrome Monochrome #FFFFFF #111111 No hue: ink, paper, greys
high-contrast High Contrast #B8CCFF #0A2E9E Pure black/white fields, AAA text, strong borders

Semantic roles of a LunarTheme: windowBackground, windowBackgroundDeep, chromeSurface, elevatedSurface, sunkenSurface, glassTint, hairline, hairlineStrong, textPrimary, textSecondary, textTertiary, accent, accentSecondary, onAccent, success, warning, danger, selection, focusRing, glow, orbitRings (three, innermost first), orbitCore, star, shadow, and tints (one colour per LunarTint).

LunarTint has exactly the ten workspace cases (lunarBlue, spectralViolet, auroraMint, silver, solar, rose, ocean, forest, ember, nebula); the app maps its own workspace tint with LunarTint(rawValue: tint.rawValue).

swift
// At the root of each scene. Follows the colour scheme and the Increase Contrast setting.
ContentView().lunarTheme(LunarThemes.family(id: storedThemeID))
// or force an appearance
ContentView().lunarTheme(LunarThemes.aurora, appearance: .dark)

// In any view
@Environment(\.lunarTheme) private var theme
Text("Hello").foregroundStyle(theme.textPrimary)

# Contrast guarantees (tested)

ThemeTests computes WCAG 2 contrast for all 24 renditions and their Increase Contrast renditions, against every surface text may sit on (window, deep window, chrome, elevated, sunken):

  • primary text ≥ 4.5:1 (≥ 7:1 in High Contrast);
  • secondary text ≥ 4.5:1 (≥ 7:1 in High Contrast); tertiary text ≥ 3:1;
  • accent, secondary accent, success, warning, danger, focus ring, orbit core and all ten tints ≥ 3:1;
  • accent ≥ 4.5:1 on window, chrome and elevated surfaces (it is used as text); text on an accent fill ≥ 4.5:1;
  • primary text ≥ 4.5:1 and accent ≥ 3:1 on the selection fill.

Palettes were adjusted until these passed; thresholds were not lowered.

# 4. Materials and the Liquid Glass policy

One modifier draws every glass surface:

swift
view.lunarGlass(.capsule, style: .chrome, elevation: .floating, interactive: false, tint: nil)
Condition What is drawn
OS 26 and later Liquid Glass: glassEffect(Glass.regular.tint(…).interactive(…), in: shape), behind if #available(macOS 26.0, iOS 26.0, *)
macOS 15 / iOS 18 .thinMaterial (.regularMaterial for .dense) + theme tint + top highlight
Reduce Transparency, or lunarRenderMode == .snapshot Opaque chromeSurface / elevatedSurface + top highlight
Always Luminous hairline (brighter at the top edge) and the soft elevation shadow

Rules:

  • Glass styles: .chrome (bars, sidebars, docks, panels), .control (buttons, chips, selected tabs), .dense (banners, toasts: must stay readable over arbitrary web content).
  • Never behind page body text. Content that carries reading text inside a panel goes on an opaque LunarCard.
  • No permanent expensive blur: only system materials and glassEffect, which the system composites and caches; no .blur() on live content, no full-window material.
  • interactive: true only on tappable surfaces.
  • The shadow never exceeds the floating elevation.

# 5. Iconography

All drawn in code on a fixed grid, resolution independent (Sources/LunarDesign/Icons/).

  • ORIX Navigator mark — LunarMarkView (full colour, themed) and LunarMarkShape (single colour): an orbital ring around a core with a navigation needle, and a satellite on the ring. Geometry in LunarMarkGeometry (100-unit grid), mirrored by the app icon script.
  • Module glyphs — LunarGlyph (24-unit grid, one stroke weight of 1.7, at most a couple of solid accents): command, orbit, split, agent, memory, ghost, time, canvas, blink, lens, shield, archive, morph, reader, dev, flow, capsule, bridge, media, focus. Use LunarGlyphView(_:size:label:) or LunarGlyphShape. Tests check that each glyph renders, stays in its box, has sensible coverage at 16 pt and differs from every other glyph on a 16 × 16 grid. See DesignSystem/reference/glyphs--lunar-*.png.
  • LunarIcon (.symbol("name") or .glyph(.orbit)) is what components take; SF Symbols cover generic actions.

# 6. Component catalogue

Every component is themed, labelled for assistive technologies, draws the Lunar focus ring when it has keyboard focus, and keeps a 44 pt hit target on iOS (28 pt on macOS) through lunarHitTarget().

Component API Notes
Glass surface .lunarGlass(_:style:elevation:interactive:tint:) see §4
Hairline, shadow .lunarHairline(_:), .lunarShadow(_:), LunarHairline(_ axis)
Window field LunarWindowBackground() the theme gradient
Capsule bar LunarCapsuleBar { … } floating toolbar / omnibox container
Icon button LunarIconButton(_:label:style:isActive:diameter:action:) styles .plain, .glass, .accent; tooltip = label
Chip LunarChip(_:icon:isOn:), LunarChip(_:icon:isSelected:action:) pill toggle
Buttons .buttonStyle(.lunar(.primary / .secondary / .destructive, size:fullWidth:)) sizes compact, regular, large
Press feedback LunarPressStyle() for custom tappable content
Text field LunarTextField(_:text:icon:), .lunarField(_:isFocused:) modifier styles any TextField / SecureField
Search field LunarSearchField(text:prompt:leading:accessory:) base of the omnibox; attach .onSubmit
List row LunarListRow(_:subtitle:icon:isSelected:action:trailing:) also custom leading/trailing
Section header LunarSectionHeader(_:actionTitle:action:) header trait
Card LunarCard(padding:shape:elevation:) { … } opaque: may hold body text
Badge LunarBadge(_:status:icon:) LunarStatus: neutral, accent, success, warning, danger
Progress LunarProgressBar(value:label:), LunarProgressRing(value:label:size:) nil = indeterminate; frozen under Reduce Motion
Label LunarLabel(_:icon:help:) tooltip + accessibility hint from one string
Empty / error state LunarEmptyState(icon:title:message:actionTitle:action:), LunarErrorState(title:message:retryTitle:retry:)
Banner, toast LunarBanner(_:title:message:actionTitle:action:onDismiss:), LunarToast(_:status:) dense glass
Sheet header LunarSheetHeader(_:subtitle:icon:onClose:)
Segmented control LunarSegmentedControl(_:selection:segments:) with LunarSegment gliding thumb
Slider LunarSlider(_:value:in:step:) arrow keys; VoiceOver through a native Slider representation
Toggle Toggle(…).toggleStyle(.lunar) I/O marks under Differentiate Without Colour
Tab chip LunarTabChip(title:favicon:tint:isSelected:isPinned:isLoading:audio:layout:onSelect:onClose:onToggleMute:) horizontal pill or vertical row; monogram fallback (LunarMonogram)
Planet, satellite LunarPlanet(tint:size:isActive:hasRing:), LunarSatelliteChip(_:tint:isActive:count:action:) workspaces
Key caps LunarKeyCap(_:), LunarShortcut("⌘K") read as "Command K"
Orbital rings LunarOrbitRings(count:squash:tilt:), LunarOrbitRings.radiusFraction(ring:of:) skeleton of the Orbit view
Starfield LunarStarfield(density:showsOrbits:isAnimated:) optional backdrop, see §7
Gallery LunarGallery(), LunarGalleryContent(layout:) every token, theme and component

SwiftUI previews exist for buttons, fields, containers, feedback, controls, tabs, starfield and the gallery.

# 7. Motion

  • Springs only (LunarMotion), so every animation is interruptible and retargetable. Use .lunarAnimation(_:value:) and .lunarTransition(anchor:); transitions are geometric (scale + fade from an anchor, matchedGeometryEffect for the segmented thumb).
  • Reduce Motion: springs become a 0.14 s fade, press scaling is dropped, indeterminate progress shows a static segment, the starfield draws one frame and never schedules another.
  • Starfield cost control: 12 fps TimelineView, half-resolution Canvas scaled up, asynchronous rendering, paused when off screen and when the window or scene is inactive (controlActiveState on the Mac, scenePhase on iOS). Do not add a second animated full-window canvas.
  • Haptics: LunarHaptics.play(.selection / .lightImpact / .mediumImpact / .success / .warning / .error) on iPhone; trackpad alignment feedback on the Mac where an equivalent exists.

# 8. Accessibility

Setting Behaviour
Dynamic Type all text uses system text styles
Reduce Motion see §7
Reduce Transparency every glass surface becomes an opaque theme surface
Increase Contrast lunarTheme(_ family:) switches to theme.increasedContrast (stronger secondary text, hairlines 1.5 pt and darker, stronger selection); the High Contrast theme is also available as a choice
Differentiate Without Colour active icon buttons get an underline, selected chips a check mark, selected rows and tabs a bar, status badges a symbol, the switch I/O marks
VoiceOver labels on every control; .isSelected, .isHeader, .updatesFrequently traits; tab state in the accessibility value ("Pinned, Loading, Playing audio"); decorative glyphs hidden
Keyboard (Mac) custom focus ring (lunarFocusRing), arrow keys on the slider
Hit targets 44 pt on iOS, 28 pt on macOS

# 9. Do / Don't

Do

  • read colours from @Environment(\.lunarTheme); use spacing and radius tokens;
  • put chrome on lunarGlass, reading text on LunarCard or the window field;
  • give every icon-only control a label;
  • use LunarTint for workspaces and LunarStatus for meaning.

Don't

  • hard-code a hex value or a Color in a feature view;
  • put glass behind page text or stack glass on glass more than one level deep;
  • add borders thicker than a hairline, sharp corners, or shadows heavier than floating;
  • animate with fixed-duration curves, or ignore Reduce Motion;
  • reorder or rename LunarTint cases or theme ids (they are persisted).

# 10. Reference renders, icon and how to regenerate

Output Path
Gallery (Lunar, Aurora, Solar × dark, light) DesignSystem/reference/gallery--<theme>-<variant>.png
Mac main window DesignSystem/reference/mac-window--<theme>-<variant>.png
iPhone DesignSystem/reference/iphone--<theme>-<variant>.png
iPad DesignSystem/reference/ipad--<theme>-<variant>.png
Orbit view DesignSystem/reference/orbit--<theme>-<variant>.png
New-tab page DesignSystem/reference/new-tab--<theme>-<variant>.png
Glyph sheet (16 / 24 / 48 pt) DesignSystem/reference/glyphs--lunar-<variant>.png
Tokens DesignSystem/tokens.json
App icon masters DesignSystem/AppIcon/AppIcon-1024.png, AppIcon-iOS-1024{,-dark,-tinted}.png
Asset catalogs DesignSystem/AppIcon/macOS/AppIcon.appiconset, DesignSystem/AppIcon/iOS/AppIcon.appiconset
sh
scripts/render-design-reference.sh              # gallery + mockups + tokens.json
scripts/render-design-reference.sh --tokens     # tokens.json only
scripts/render-design-reference.sh --icon       # app icon (same as: swift scripts/make-icon.swift)
scripts/render-design-reference.sh --all        # everything
scripts/render-design-reference.sh --all --isolated   # build LunarDesign alone, if another module does not compile

How the renders are made, and their limits:

  • The mockups live in the test target (Tests/LunarDesignTests/ReferenceMockups.swift) and are built from the real components. Their page titles, counts and the neutral page placeholder are fixtures that exist only there.
  • They are drawn offscreen with ImageRenderer in lunarRenderMode == .snapshot. ImageRenderer cannot capture live materials, Liquid Glass or platform text fields, so the renders show the opaque glass fallback (the Reduce Transparency look) and static text in fields. On a device, chrome is translucent; layout, colour, type and iconography are otherwise the same.
  • The app icon is drawn by scripts/make-icon.swift with CoreGraphics, every size from vectors. The iOS images are opaque (no alpha channel); the macOS images use the rounded-tile grid with a transparent margin. No text.
Files main
Menu

Theme