The library exposes two module types for consumption:
- Foundation — Core theme infrastructure with token definitions and
EsdsTheme.Valuescomposition - Theme* — Theme implementations (e.g.
ThemeMail,ThemeCalendar) that provide themedEsdsTheme.Valuesinstances that can be consumed through composition local by providing it throughLocalEsdsTheme
The README for the material tokens generator script can be found in scripts/README.md.
These colors must be consumed to support material functionalities such as accessibility settings for contrasts or user's system colors.
Tokens are generated through PRs automatically opened on this repo, but those PRs are incomplete and can't be consumed as-is.
The generated code only produces internal instances for the classes defined in the tokens folder.
Each theme module also needs a public EsdsTheme.Values instance that groups those internal tokens together. One instance
must be created manually per exposed theme (light, dark, etc.).
The different dimensions for light/dark/etc. should be the following and will be used according to the user's accessibility settings:
- Light
- LightMediumContrast
- LightHighContrast
- Dark
- DarkMediumContrast
- DarkHighContrast
The new instances are stored at the module's root level like the other token instances.
MailLightTheme should look like:
val MailLightTheme: EsdsTheme.Values = EsdsTheme.Values(
icon = MailLightIconTokens,
spacing = MailLightSpacingTokens,
radius = MailLightRadiusTokens,
materialColorScheme = LightScheme,
)