SPB Git

spb/zyquo-atlas Public License

The AI-native macOS web browser — every surface, intelligent.

Swift 75.2% JavaScript 22% Shell 2% Makefile 0.9%
3.0 KB · 95 lines swift
Raw Blame History
1//2//  ZyquoTheme.swift3//  Zyquo Atlas4//5//  Author: Simon-Pierre Boucher6//  Mail: contact@spboucher.ai7//8//  The non-color design tokens: typography, spacing, radii, shadows, and layout9//  metrics — views contain zero magic numbers. Colors live in AtlasTheme /10//  BuiltInThemes and are applied live by ThemeEngine (the flagship "Atlas Light"11//  theme is the Phase 4.1 base spec); fonts scale with the user's uiScale via12//  LayoutSettings. Atlas's identity is a balanced teal-indigo "map/atlas" story.13//1415import SwiftUI1617extension NSColor {18    /// 0xRRGGBB → NSColor (sRGB).19    convenience init(hex: UInt32) {20        self.init(21            srgbRed: CGFloat((hex >> 16) & 0xFF) / 255,22            green: CGFloat((hex >> 8) & 0xFF) / 255,23            blue: CGFloat(hex & 0xFF) / 255,24            alpha: 125        )26    }27}2829// MARK: - Typography3031/// Type scale (SF Pro system font; SF Mono for code). Body is 13.5pt/1.45 per32/// the family spec.33enum ZyquoFont {34    /// 20pt semibold — window/section titles.35    static let title = Font.system(size: 20, weight: .semibold)36    /// UI body at a given size (default 13.5).37    static func body(size: Double = 13.5) -> Font {38        .system(size: size, weight: .regular)39    }40    static func bodyEmphasis(size: Double = 13.5) -> Font {41        .system(size: size, weight: .medium)42    }43    /// 12.5pt medium — omnibox / tab titles.44    static let control = Font.system(size: 12.5, weight: .medium)45    /// 11pt — captions, status.46    static let caption = Font.system(size: 11, weight: .regular)47    static func code(size: Double = 12.5) -> Font {48        .system(size: size, weight: .regular, design: .monospaced)49    }50    /// Generous line height for body text (spec: 1.45 → factor 0.45).51    static let bodyLineSpacingFactor: Double = 0.4552}5354// MARK: - Spacing, radii, shadows, metrics5556/// Spacing scale: 4 / 8 / 12 / 16 / 20 / 24 / 32.57enum ZyquoSpacing {58    static let xxs: CGFloat = 459    static let xs: CGFloat = 860    static let sm: CGFloat = 1261    static let md: CGFloat = 1662    static let lg: CGFloat = 2063    static let xl: CGFloat = 2464    static let xxl: CGFloat = 3265}6667/// Corner radii: 6 (small controls), 10 (cards/tabs), 14 (floating panels).68enum ZyquoRadius {69    static let small: CGFloat = 670    static let medium: CGFloat = 1071    static let large: CGFloat = 1472}7374/// Shadows: extremely soft, used sparingly (floating panels, popovers).75enum ZyquoShadow {76    static let soft = ShadowStyle(color: .black.opacity(0.06), radius: 12, y: 2)7778    struct ShadowStyle {79        let color: Color80        let radius: CGFloat81        var x: CGFloat = 082        var y: CGFloat = 083    }84}8586/// Fixed layout metrics (chrome must be quiet so web content is the star).87enum ZyquoMetrics {88    static let toolbarHeight: CGFloat = 4489    static let tabBarHeight: CGFloat = 3690    static let tabMinWidth: CGFloat = 12091    static let tabMaxWidth: CGFloat = 24092    static let aiSidebarWidth: CGFloat = 36093    static let hairline: CGFloat = 0.594}95