Docs

Theming

Customize every visual aspect through the S0 design-token system.

All S0 components reference a central S0.Theme struct defined in S0Theme.swift. Changing a token value updates every component that uses it.

Spacing

TokenValueUsage
Spacing.xxs2 ptTight gaps, required indicator offset
Spacing.xs4 ptInline spacing, label gaps
Spacing.sm8 ptIcon-to-text gaps, compact padding
Spacing.md12 ptDefault horizontal padding, HStack spacing
Spacing.lg16 ptSection padding, card padding
Spacing.xl24 ptLarge section spacing
Spacing.xxl32 ptExtra-large button padding

Radius

TokenValueUsage
Radius.sm4 ptCheckboxes, small elements
Radius.md8 ptDefault component radius, inputs
Radius.lg12 ptCards, alerts, toasts
Radius.xl16 ptLarge containers
Radius.full9999 ptBadges, avatars, pills

The default Theme.radius used by most components is Radius.md (8 pt).

Typography

TokenSizeWeight
Typography.largeTitle34 ptBold
Typography.title22 ptBold
Typography.headline17 ptSemibold
Typography.body17 ptRegular
Typography.callout16 ptRegular
Typography.subheadline15 ptRegular
Typography.footnote13 ptRegular
Typography.caption12 ptRegular
Typography.button14 ptMedium

Colors

Colors adapt automatically to light/dark mode via system APIs.

TokenLightDark
Colors.primaryColor.primaryColor.primary
Colors.primaryForegroundsystemBackgroundwindowBackgroundColor
Colors.backgroundsystemBackgroundwindowBackgroundColor
Colors.cardsystemBackgroundwindowBackgroundColor
Colors.secondaryBackgroundsecondarySystemBgcontrolBackgroundColor
Colors.mutedtertiarySystemFillunderPageBgColor
Colors.borderseparatorseparatorColor
Colors.destructiveColor.redColor.red
Colors.successColor.greenColor.green
Colors.warningColor.orangeColor.orange

Shadows

TokenRadiusOpacityY Offset
Shadow.sm2 pt5%1 pt
Shadow.md6 pt10%3 pt
Shadow.lg15 pt15%8 pt

Apply with the .s0Shadow(.md) view modifier.

Animation

TokenCurveDuration
Animation.fasteaseOut0.1s
Animation.defaulteaseOut0.2s
Animation.sloweaseInOut0.35s
Animation.springspring(response: 0.35, damping: 0.7)

Customizing tokens

Since you own the code, just edit S0Theme.swift directly. For example, to change the default corner radius:

// S0Theme.swift
public struct Theme {
    // Change the default radius
    public static let radius: CGFloat = Radius.lg  // was Radius.md

    // Customize spacing
    public struct Spacing {
        public static let lg: CGFloat = 20  // was 16
    }
}