Instantly share code, notes, and snippets.

Embed
What would you like to do?
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