This module contains the theme tokens for the application, including those auto-generated from Compound and its mappings.
The module contains public tokens and color schemes that are later used in MaterialTheme
and added to ElementTheme
for use in the application.
All tokens can be accessed through the ElementTheme
object, which contains the following properties:
ElementTheme.materialColors
: contains all Material color tokens. In Figma, they're prefixed withM3/
. It's an alias toMaterialTheme.colorScheme
.ElementTheme.colors
: contains all Compound semantic color tokens. In Figma, they're prefixed with eitherLight/
orDark/
.ElementTheme.typography
: contains the CompoundTypographyTokens
values. In Figma, they're prefixed withAndroid/font/
.
All new tokens should come from Compound and added to the compound.generated
package. Same thing for the value of compoundColorsLight
, compoundColorsDark
, compoundColorsHcLight
and compoundColorsHcDark
.
To run Roborazzi test, run:
./gradlew :compound:verifyRoborazziDebug
To record the screenshot, run:
./gradlew :compound:recordRoborazziDebug
To release a new version of the module, you'll have to:
- Update the version in
compound/build.gradle.kts
. - Create a
version-x.y.z
branch and create a PR. - When the PR is merged, a new tag will be created and the module will automatically be published to Maven Central.