Skip to content

Instantly share code, notes, and snippets.

@krummler
Last active April 17, 2020 13:19
Show Gist options
  • Save krummler/579489256d58e5c95910c2f0bdcccabc to your computer and use it in GitHub Desktop.
Save krummler/579489256d58e5c95910c2f0bdcccabc to your computer and use it in GitHub Desktop.
private struct Palette {
static let foreground = UIColor(named: "color/foreground")!
}
struct ComponentStyle {
struct Button {
private static let defaultInsets = UIEdgeInsets(top: 12, left: 16, bottom: 12, right: 16)
private static let defaultFont = UIFont.preferredFont(forTextStyle: .body)
static let primary =
ButtonStyle(font: defaultFont,
insets: defaultInsets,
enabled: ButtonStateStyle(foreground: Palette.foreground, background: UIImage(named: "button/primary/enabled")!),
highlighted: ButtonStateStyle(foreground: Palette.foreground, background: UIImage(named: "button/primary/highlighted")!),
disabled: ButtonStateStyle(foreground: Palette.foreground, background: UIImage(named: "button/primary/disabled")!))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment