thunderbird-android/core/ui/compose/theme
2023-10-18 14:32:59 +02:00
..
src/main Merge pull request #7262 from thundernest/image_with_baseline 2023-10-18 14:32:59 +02:00
build.gradle.kts Add Icons to theme to wrap material icons 2023-05-10 16:28:17 +02:00
README.md Add design system README 2023-03-01 13:46:25 +01:00

Core - UI - Compose - Theme

This provides the MainTheme with dark/light variation, a wrapper for the Compose Material2 theme. It supports CompositionLocal changes to colors, typography, shapes and adds additionally elevations, sizes, spacings and images.

To change Material2 related properties use MainTheme instead of MaterialTheme:

  • MainTheme.colors: Material2 colors
  • MainTheme.typography: Material 2 typography
  • MainTheme.shapes: Material2 shapes
  • MainTheme.spacings: Spacings (quarter, half, default, oneHalf, double, triple, quadruple) while default is 8 dp.
  • MainTheme.sizes: Sizes (smaller, small, medium, large, larger, huge, huger)
  • MainTheme.elevations: Elevation, e.g. card
  • MainTheme.images: Images used across the theme, e.g. logo

Included are two derived themes for K-9 and Thunderbird look: K9Theme and ThunderbirdTheme.

To render previews for both themes use PreviewWithThemes. This also includes a dark/light variation:

@Preview(showBackground = true)
@Composable
fun MyViewPreview() {
    PreviewWithThemes {
        MyView()
    }
}