Skip to content

Commit

Permalink
[fluent] Fixed Layer can't override LocalContentAlpha.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanlorng committed May 31, 2024
1 parent 8a675b8 commit ffe515a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import com.konyaco.fluent.FluentTheme
import com.konyaco.fluent.LocalContentAlpha
import com.konyaco.fluent.LocalContentColor
import com.konyaco.fluent.ProvideTextStyle
import kotlin.math.sqrt
Expand Down Expand Up @@ -91,7 +92,10 @@ fun Layer(
content: @Composable () -> Unit
) {
ProvideTextStyle(FluentTheme.typography.body.copy(color = contentColor)) {
CompositionLocalProvider(LocalContentColor provides contentColor) {
CompositionLocalProvider(
LocalContentColor provides contentColor,
LocalContentAlpha provides contentColor.alpha
) {
Box(
modifier = modifier.layer(
elevation,
Expand Down

0 comments on commit ffe515a

Please sign in to comment.