StylishTheme

fun StylishTheme(darkTheme: Boolean, dynamicColor: Boolean = false, seedColor: Color? = null, colorScheme: ColorScheme = if (darkTheme) StylishDarkColorScheme else StylishLightColorScheme, typography: Typography = StylishTypography, materialShapes: Shapes = Shapes(), dimensions: StylishDimensions = DefaultStylishDimensions, shapes: StylishShapes = DefaultStylishShapes, animation: StylishAnimationTokens = DefaultStylishAnimationTokens, componentColors: StylishComponentColors? = null, content: @Composable () -> Unit)

Root theme composable that applies the Stylish UI design language to all descendant content.

Wraps MaterialTheme with a CompositionLocalProvider for StylishDimensions, StylishAnimationTokens, StylishShapes, and StylishComponentColors, giving every Stylish component access to consistent spacing, corner-radius, elevation, outline, motion, shape, and derived-color tokens. Place this at the top of your composable hierarchy (typically in your Activity or App composable) so that all child components inherit the design tokens.

Parameters

darkTheme

Whether to use the dark color scheme. Typically derived from isSystemInDarkTheme().

dynamicColor

When true and the platform supports it (Android 12+), the wallpaper derived Material You scheme overrides colorScheme. On other platforms this parameter has no effect. Ignored while seedColor resolves a scheme.

seedColor

When non-null, a seed color used to generate a Material You style ColorScheme on every platform via MaterialKolor, overriding both dynamicColor and colorScheme. Use this for brand-colored themes that still follow the tonal Material 3 color system.

colorScheme

The Material 3 ColorScheme to apply. Defaults to StylishDarkColorScheme when darkTheme is true, otherwise StylishLightColorScheme. Ignored when seedColor or dynamicColor resolves a dynamic scheme.

typography

The Material 3 Typography scale. Defaults to StylishTypography.

materialShapes

The Material 3 Shapes scale applied to M3 primitives that do not use an explicit shape parameter. Defaults to the Material 3 defaults. Use shapes to style Stylish-specific shape tokens.

dimensions

The StylishDimensions spatial tokens. Defaults to DefaultStylishDimensions. Override globally here, or per-component via individual parameters.

shapes

The StylishShapes corner-radius tokens. Defaults to DefaultStylishShapes. Override globally here, or per-component via individual parameters.

animation

The StylishAnimationTokens motion tokens. Defaults to DefaultStylishAnimationTokens. Override globally here, or per-component via individual parameters where available.

componentColors

The StylishComponentColors used by Stylish components. When null (the default) they are computed from the resolved ColorScheme; pass an instance to override the derived colors globally.

content

The composable content that will be themed.

See also