-
Notifications
You must be signed in to change notification settings - Fork 6
23 ‐ Figma troubleshooting
The design team behind OUDS uses Figma to define the tokens (i.e. the configuration variables used across themes for components) and components. However even if the tool does not have the needed features, some concepts have been designed by the designers team to match the needs of Orange Unifed Design System, and we need in the iOS development side to find workarounds.
First, in the UI kit, some tokens have been designed to contain several values depending to what we call on iOS the color scheme (i.e. light mode or dark mode) and the size class (i.e. regular or compact mode, the viewport for web front).
Here are the tokens families which depend to the color scheme:
- color semantic tokens (wrapped in
MultipleColorSemanticTokens) - elevation semantic tokens (wrapped in
MultipleElevationCompositeRawTokens)
Here are the tokens families which depend to the size class:
- font letter spacing semantic tokens (wrapped in
MultipleFontLetterSpacingSemanticTokens) - font line height semantic tokens (wrapped in
MultipleFontLineHeightSemanticTokens) - font size semantic tokens (wrapped in
MultipleFontSizeSemanticTokens) - size semantic tokens (wrapped in
MultipleSizeSemanticTokens) - space semantic tokens (wrapped in
MultipleSpaceSemanticTokens) - font semantic tokens (wrapped in
MultipleFontCompositeRawTokens)
Because Figma cannot manage such "multiple" tokens, it produces only the variables to use suffixed by Light and Dark for color-scheme-related tokens, and suffixed by Mobile and Tablet for size-class-related tokens. The tokenator then parses the JSON Figma outputs and generates these suffixed Swift variables. The devlopment team in its side will keep up-to-date the "multiple" tokens wrapping the values to use.
Any "multiple" token is declared in a "Multiple" protocol. For example, MultipleColorSemanticTokens are all declared in ColorMultipleSemanticTokens. The color semantic tokens to use (i.e. of type ColorSemanticToken) are all declared in ColorSemanticTokens.
Second, some tokens are "composite", i.e. are defined with other tokens values. For example, the UI kit defines some elevation token which are defined by an X offset, a Y offset, a color for the shadow and a blur effect. These four things are also tokens, i.e. X and Y offsets and blur values are ElevationRawTokenand color is ColorRawToken. Thus, an elevation effect is defined by a combination of these four values (ElevationCompositeRawToken).
There are also "composite" tokens for fonts, which are defined by a font size (FontSizeRawToken), a font line height (FontLineHeightRawToken), a font weight (FontWeightRawToken) and a font letter spacin (FontLetterSpacingRawToken).
However, just like "multiple" values, Figma is not able to manage such type of tokens and the tokenator does not receive the objects in the JSON to process.
All ElevationCompositeRawToken are defined in ElevationRawTokens enum file but seperated to the other generated values.
All FontCompositeRawToken are defined in FontRawTokens enum file but seperated to the other generated values.
Thus, the iOS develoment team keeps updated these tokens, and the tokenator can bring updates for any values to use to define theme.
Here are the files the tokenator cannot automatically update because cannot guess some logic not available in its JSON to process:
-
ColorMultipleSemanticTokensdefinitions inOrangeTheme+ColorMultipleSemanticTokens.swift -
ElevationCompositeSemanticTokensdefinitions inOrangeTheme+ElevationCompositeSemanticTokens.swift -
ElevationMultipleSemanticTokensdefinitions inOrangeTheme+ElevationMultipleSemanticTokens.swift -
SizeMultipleSemanticTokensdefinitions inOrangeTheme+SizeMultipleSemanticTokens.swift -
SpaceMultipleSemanticTokensdefinitions inOrangeTheme+SpaceMultipleSemanticTokens.swift -
FontCompositeSemanticTokensdefinitions inOrangeTheme+FontCompositeSemanticTokens.swift OrangeTheme+SemanticColorTokens.swift-
ElevationCompositeRawTokendefinitions inElevationRawTokens+Composites.swift -
FontRawTokensdefinitions inFontRawTokens+Composites.swift -
ElevationRawTokenscomposites definitions inElevationRawTokens+Composites.swift -
FontRawTokenscomposites definitions inFontRawTokens+Composites.swift
-
ColorMultipleSemanticTokensdeclarations inColorMultipleSemanticTokens.swift -
ElevationCompositeSemanticTokensdeclarations inElevationCompositeSemanticTokens.swift -
ElevationMultipleSemanticTokensdeclarations inElevationMultipleSemanticTokens.swift -
SizeMultipleSemanticTokensdeclarations inSizeMultipleSemanticTokens.swift -
SpaceMultipleSemanticTokensdeclarations inSpaceMultipleSemanticTokens.swift -
FontCompositeSemanticTokensdeclarations inFontCompositeSemanticTokens.swift -
FontMultipleSemanticTokensdeclarations in *ontMultipleSemanticTokens.swift
Also, the tokenator does not update protocols declaring semantic and components tokens.
Here are the files tokenator updates:
-
BorderRawTokensdefinitions inBorderRawTokens+Values.swift -
ColorRawTokensdefinitions inColorRawTokens+Values.swift -
DimensionRawTokensdefinitions inDimensionRawTokens+Values.swift -
ElevationRawTokensdefinitions inElevationRawTokens+Values.swift -
GridRawTokensdefinitions inGridRawTokens+Values.swift -
OpacityRawTokensdefinitions inOpacityRawTokens+Values.swift -
FontRawTokensdefinitions inFontRawTokens+Values.swift(soon)
-
BorderSemanticTokensdefinitions inOrangeTheme+BorderSemanticTokens.swift -
ColorSemanticTokensdefinitions inOrangeTheme+ColorSemanticTokens.swift -
ElevationSemanticTokensdefinitions inOrangeTheme+ElevationSemanticTokens.swift -
GridSemanticTokensdefinitions inOrangeTheme+GridSemanticTokens.swift -
OpacitySemanticTokensdefinitions inOrangeTheme+OpacitySemanticTokens.swift -
SizeSemanticTokensdefinitions inOrangeTheme+SizeSemanticTokens.swift -
SpaceSemanticTokensdefinitions inOrangeTheme+SpaceSemanticTokens.swift -
FontSemanticTokensdefinitions inOrangeTheme+FontSemanticTokens.swift
-
BadgeComponentTokensdefinitions inOrangeTheme+BadgeComponentTokens.swift -
BreadcrumbComponentTokensdefinitions inOrangeTheme+BreadcrumbComponentTokens.swift -
BulletListComponentTokensdefinitions inOrangeTheme+BulletListComponentTokens.swift -
ButtonComponentTokensdefinitions inOrangeTheme+ButtonComponentTokens.swift -
CheckboxComponentTokensdefinitions inOrangeTheme+CheckboxComponentTokens.swift -
ChipComponentTokensdefinitions inOrangeTheme+ChipComponentTokens.swift -
ControlItemComponentTokensdefinitions inOrangeTheme+ControlItemComponentTokens.swift -
InputTextComponentTokensdefinitions inOrangeTheme+InputTextComponentTokens.swift -
LinkComponentTokensdefinitions inOrangeTheme+LinkComponentTokens.swift -
ListItemComponentTokensdefinitions inOrangeTheme+ListItemComponentTokens.swift -
RadioComponentTokensdefinitions inOrangeTheme+RadioComponentTokens.swift -
SelectComponentTokensdefinitions inOrangeThemeSelectComponentTokens.swift -
SkeletonComponentTokensdefinitions inOrangeTheme+SkeletonComponentTokens.swift -
SwitchComponentTokensdefinitions inOrangeTheme+SwitchComponentTokens.swift -
TagComponentTokensdefinitions inOrangeTheme+TagComponentTokens.swift
Note that not the InverseTheme nor the OrangeTheme are managed by the tokenator, so their files are not updated (like InverseTheme+ColorSemanticTokens.swift and OrangeTheme+SemanticColorTokens.swift).
Warning
The lists above should be updated. You can have a look on the Swift sources to get answers if needed. Sorry!