Theme: every typography tier + LocalContentColor carry explicit palette ink; root Surface transparency made Compose's black default visible-on-dark text (fix unresolved foundation.LocalContentColor -> material3)
This commit is contained in:
parent
7fc388be4b
commit
81f9855c1f
1 changed files with 14 additions and 2 deletions
|
|
@ -313,17 +313,29 @@ fun ShonarTheme(
|
|||
content: @Composable () -> Unit,
|
||||
) {
|
||||
val palette = if (mode == ThemeMode.LIGHT) LightPalette else DarkPalette
|
||||
// Muted tiers carry secondary/muted ink per palette (call sites may
|
||||
// still override with an explicit color).
|
||||
// Every typography tier carries explicit per-palette ink: a TextStyle
|
||||
// with no color falls back to Compose's default BLACK, which is
|
||||
// invisible on the dark canvas (regression seen Sep 21). Call sites
|
||||
// may still override with an explicit color.
|
||||
val typography = androidx.compose.runtime.remember(palette) {
|
||||
ShonarTypography.copy(
|
||||
headlineSmall = ShonarTypography.headlineSmall.copy(color = palette.textPrimary),
|
||||
titleMedium = ShonarTypography.titleMedium.copy(color = palette.textPrimary),
|
||||
titleSmall = ShonarTypography.titleSmall.copy(color = palette.textPrimary),
|
||||
bodyLarge = ShonarTypography.bodyLarge.copy(color = palette.textPrimary),
|
||||
bodyMedium = ShonarTypography.bodyMedium.copy(color = palette.textPrimary),
|
||||
bodySmall = ShonarTypography.bodySmall.copy(color = palette.textSecondary),
|
||||
labelLarge = ShonarTypography.labelLarge.copy(color = palette.textPrimary),
|
||||
labelMedium = ShonarTypography.labelMedium.copy(color = palette.textSecondary),
|
||||
labelSmall = ShonarTypography.labelSmall.copy(color = palette.textMuted),
|
||||
)
|
||||
}
|
||||
androidx.compose.runtime.CompositionLocalProvider(
|
||||
Shonar.LocalPalette provides palette,
|
||||
// The root Surface went transparent for the meridian gradient;
|
||||
// provide the ink explicitly so LocalContentColor can't fall
|
||||
// back to Compose's black default on the dark canvas.
|
||||
androidx.compose.material3.LocalContentColor provides palette.textPrimary,
|
||||
) {
|
||||
MaterialTheme(
|
||||
colorScheme = schemeFor(palette),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue