Background/Goal
Style Dictionary (the library used for managing our design tokens) supports the ability to export tokens as mobile platform specific Android and iOS variables.
The output looks something like this:
Android:
<resources> <color name="color_base">#ff202122</color> <color name="color_base_hover">#ff404244</color> … </resources>
iOS:
.h/.m file with references
iOS-Swift
.swift files
It's also possible to provide custom prefixes like Cdx if desired.
Is this something we should consider including in the public @wikimedia/codex-design-tokens package on NPM?
Development considerations
Token modularization, source of truth that can be extended, for example by dark mode colors?
Acceptance Criteria
- Figure out if this is something we want to do (I believe at least one use-case exists per above)
- Add a new build target with format: 'android/colors'/format: 'ios/colors.h' in the tokens build configuration if so
Supporting documentation
- style-dictionary docs: https://github.com/amzn/style-dictionary/blob/main/lib/common/formats.js#L363