Protocol
FontCompositeSemanticTokens
This is a group of semantic tokens for fonts, but only composite tokens in the end. There are splitted and not declared in FontSemanticTokens as the tokenator tool parsing Figma JSON to Swift code is not able to manage them. Thus we need to declare them in another file to prevent them to be erased.
protocol FontCompositeSemanticTokens
Overview
It defines all composite font semantic tokens a theme must have, i.e. tokens including properties for font family, font weight, font size or line height for example.
This protocol makes themes able to provide and override FontCompositeSemanticToken gathered in MultipleFontCompositeSemanticToken instances. This FontCompositeSemanticToken is not managed by tokenator yet as it is composed by several properties.
This FontCompositeSemanticTokens protocol contains a set of MultipleFontCompositeSemanticToken. They can be applied to views and components using the helpers provided through View, loading four the the font famoly to use:
@Environment(\.theme) var theme
// Apply theme.fonts.displayLarge
Text("Foo bar wizz").displayLarge(theme)
// Apply theme.fonts.headingMedium
Text("Foo bar wizz").headingMedium(theme)
// Apply theme.fonts.bodyDefaultSmall
Text("Foo bar wizz").bodyDefaultSmall(theme)
// Etc.
Since
0.8.0
Topics
Instance Properties