Swift95

Theme95

The complete set of colors, metrics, fonts, spacing, and motion tokens.

Theme95 is an environment value, so one modifier can consistently restyle a whole component subtree.

Use it

import Swift95
import SwiftUI

struct Theme95Example: View {
  private var customTheme: Theme95 {
    var colors = Colors95.classic
    colors.accent = .purple
    return Theme95(
      colors: colors,
      metrics: .classic,
      fonts: .classic
    )
  }

  var body: some View {
    Button95("Save") {}
      .theme95(customTheme)
  }
}

Essential behavior

InheritanceSwift95 components read the nearest theme95 environment value.
NestingA nested theme95 modifier can restyle only one section.
ClassicTheme95.classic is the default when no override is installed.

Related

Open the complete Theme95 API reference →