Material‐3 Theming - devrath/ComposeAlchemy GitHub Wiki

About Material theming

  • In the application, certain values can change such as
    • Colour
    • Topography
    • Font
  • These values could change depending on the device's configuration.
  • An UI component could use a different color in light-theme and in dark-theme.
  • Set of fonts we could reuse across the app.
  • We can achieve all the above in the material theme.

Using colors in material theme

  • In the Color.kt we define the colors: A set of light and dark colors.
  • In the Theme.kt we assign the colors to the appropriate values in the light color set and dark color set.
  • In the Theme composable that we will wrap the entire app, we determine which set to use based on say dark & light mode.

Important references for material theme