Jetpack Compose Material 3 1.5.0-alpha15 introduces a unified `LocalMaterialTheme` CompositionLocal, replacing separate locals for color, typography, shapes, and motion. The key benefit is enabling `CompositionLocalConsumerModifierNode` to read theme data directly inside custom Modifier nodes without passing props manually or using the recomposition-heavy `composed {}` workaround. A practical example shows a `BrandGradientOverlayNode` that reads `colorScheme` directly from `LocalMaterialTheme`, contrasted with the old approaches of manual prop drilling or capturing theme values in composable scope. The post also clarifies when not to use the new API — regular composables should continue using `MaterialTheme.colorScheme` directly.
Sort: