-
Notifications
You must be signed in to change notification settings - Fork 1
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 ElevationRawToken
and 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:
-
ColorMultipleSemanticTokens
definitions inOUDSTheme+ColorMultipleSemanticTokens.swift
-
ElevationCompositeSemanticTokens
definitions inOUDSTheme+ElevationCompositeSemanticTokens.swift
-
ElevationMultipleSemanticTokens
definitions inOUDSTheme+ElevationMultipleSemanticTokens.swift
-
SizeMultipleSemanticTokens
definitions inOUDSTheme+SizeMultipleSemanticTokens.swift
-
SpaceMultipleSemanticTokens
definitions inOUDSTheme+SpaceMultipleSemanticTokens.swift
-
FontCompositeSemanticTokens
definitions inOUDSTheme+FontCompositeSemanticTokens.swift
OrangeTheme+SemanticColorTokens.swift
-
ElevationCompositeRawToken
definitions inElevationRawTokens+Composites.swift
-
FontyRawTokens
definitions inFontRawTokens+Composites.swift
-
ElevationRawTokens
composites definitions inElevationRawTokens+Composites.swift
-
FontRawTokens
composites definitions inFontRawTokens+Composites.swift
-
ColorMultipleSemanticTokens
declarations inColorMultipleSemanticTokens.swift
-
ElevationCompositeSemanticTokens
declarations inElevationCompositeSemanticTokens.swift
-
ElevationMultipleSemanticTokens
declarations inElevationMultipleSemanticTokens.swift
-
SizeMultipleSemanticTokens
declarations inSizeMultipleSemanticTokens.swift
-
SpaceMultipleSemanticTokens
declarations inSpaceMultipleSemanticTokens.swift
-
FontCompositeSemanticTokens
declarations inFontCompositeSemanticTokens.swift
-
FontMultipleSemanticTokens
declarations in *ontMultipleSemanticTokens.swift
Also, the tokenator does not update protocols declaring semantic tokens.
Here are the files tokenator updates:
-
BorderRawTokens
definitions inBorderRawTokens+Values.swift
-
ColorRawTokens
definitions inColorRawTokens+Values.swift
-
DimensionRawTokens
definitions inDimensionRawTokens+Values.swift
-
ElevationRawTokens
definitions inElevationRawTokens+Values.swift
-
GridRawTokens
definitions inGridRawTokens+Values.swift
-
OpacityRawTokens
definitions inOpacityRawTokens+Values.swift
-
FontRawTokens
definitions inFontRawTokens+Values.swift
(soon)
-
BorderSemanticTokens
definitions inOUDSTheme+BorderSemanticTokens.swift
-
ColorSemanticTokens
definitions inOUDSTheme+ColorSemanticTokens.swift
-
ElevationSemanticTokens
definitions inOUDSTheme+ElevationSemanticTokens.swift
-
GridSemanticTokens
definitions inOUDSTheme+GridSemanticTokens.swift
-
OpacitySemanticTokens
definitions inOUDSTheme+OpacitySemanticTokens.swift
-
SizeSemanticTokens
definitions inOUDSTheme+SizeSemanticTokens.swift
-
SpaceSemanticTokens
definitions inOUDSTheme+SpaceSemanticTokens.swift
-
FontSemanticTokens
definitions inOUDSTheme+FontSemanticTokens.swift
(soon)
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).