After discovering through testing that setting text colors in the typography
of MaterialTheme
would invalidate LocalContentColor
, I removed them as shown in the following code. As a result, not only does LocalContentColor
work properly now, but the colors parameter of TextField
also functions correctly.
If you set colors on Typography
, these colors from styles already bound to certain parts of Material components, such as TextField
, will take precedence over the colors parameter of TextField
or LocalContentColor
MaterialTheme(
colorScheme = colorScheme,
typography = Typography(
bodyMedium = TextStyle(
color = Color.Black // removed
),
// ...
),
content = content
)