Skip to content

Commit

Permalink
Add LocalTextStyle setup to Chip (#677)
Browse files Browse the repository at this point in the history
add LocalTextStyle setup to Chip

Signed-off-by: Ivan Morgillo <[email protected]>
  • Loading branch information
hamen authored Nov 6, 2024
1 parent 58a16f4 commit 5b0d487
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Chip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import org.jetbrains.jewel.foundation.state.FocusableComponentState
import org.jetbrains.jewel.foundation.state.SelectableComponentState
import org.jetbrains.jewel.foundation.theme.JewelTheme
import org.jetbrains.jewel.foundation.theme.LocalContentColor
import org.jetbrains.jewel.foundation.theme.LocalTextStyle
import org.jetbrains.jewel.ui.component.styling.ChipStyle
import org.jetbrains.jewel.ui.focusOutline
import org.jetbrains.jewel.ui.theme.chipStyle
Expand Down Expand Up @@ -175,7 +176,12 @@ private fun ChipImpl(
) {
val resolvedContentColor = colors.contentFor(state = chipState).value.takeOrElse { LocalContentColor.current }

CompositionLocalProvider(LocalContentColor provides resolvedContentColor) { content() }
CompositionLocalProvider(
LocalContentColor provides resolvedContentColor,
LocalTextStyle provides LocalTextStyle.current.copy(color = colors.contentFor(chipState).value),
) {
content()
}
}
}

Expand Down

0 comments on commit 5b0d487

Please sign in to comment.