[Compound] Integrate compound tokens (#586)
* Added tokens. * Apply color to MaterialTheme, also add typography. * Map colors to the right ones in the themes. * Create and improve previews of some components * More preview improvements * Add `tertiary` and `onTertiary` colors, remove some unused ones. * Fix usage of deleted color token * Fix bug in Switch previews * Create a separate `:libraries:theme` module to keep everything related to colors, typography and Compound in general. * Fix `DatePickerPreview` * Add missing Compound generated files by fixing their package name * Move `ElementTheme` to the `:libraries:theme` module, make some variables internal. --------- Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
parent
8c7183807c
commit
02dc447624
691 changed files with 3460 additions and 1460 deletions
13
libraries/theme/README.md
Normal file
13
libraries/theme/README.md
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# Theme Module
|
||||
|
||||
This module contains the theme tokens for the application, including those auto-generated from [Compound](https://github.com/vector-im/compound-design-tokens) and its mappings.
|
||||
|
||||
## Usage
|
||||
|
||||
The module contains public tokens and color schemes that are later used in `MaterialTheme` and added to `ElementTheme` for use in the application.
|
||||
|
||||
## Adding new tokens
|
||||
|
||||
All new tokens **should** come from Compound and added to the `compound.generated` package. To map the literal tokens to the semantic ones, you'll have to update both `compoundColorsLight` and `compoundColorsDark` in `CompoundColors.kt`.
|
||||
|
||||
As we're still migrating to using Compound tokens, it's possible that you might need to add some tokens manually. In that case, you should add them to `LegacyColors.kt` and map them later in `ElementColors.kt` so they can be used in light and dark themes. However, keep in mind this is just a temporary step, as those tokens should either be added later to Compound or replaced by Compound tokens in the future.
|
||||
Loading…
Add table
Add a link
Reference in a new issue