Skip to content

Instantly share code, notes, and snippets.

@malcommac
Created May 20, 2018 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malcommac/14e1361d7acff0a099a0ba121ddf3379 to your computer and use it in GitHub Desktop.
Save malcommac/14e1361d7acff0a099a0ba121ddf3379 to your computer and use it in GitHub Desktop.
let base = Style {
$0.font = SystemFonts.Helvetica.font(size: 12)
}
let h1 = Style {
$0.font = SystemFonts.Helvetica_Bold.font(size: 15)
$0.color = UIColor.red
}
let h2 = h1.byAdding {
$0.alignment = .center
$0.traitVariants = [TraitVariant.italic]
}
Styles.register("MyStyle", style: StyleGroup(base: base, ["h1" : h1, "h2" : h2]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment