@@ -10,43 +10,27 @@ import top.yukonga.miuix.kmp.utils.MiuixIndication
1010/* *
1111 * The default theme that provides color and text styles for the Miuix components.
1212 *
13- * @param colorScheme The color scheme for the Miuix components.
13+ * @param colors The color scheme for the Miuix components.
1414 * @param textStyles The text styles for the Miuix components.
1515 * @param content The content of the Miuix theme.
1616 */
1717@Composable
1818fun MiuixTheme (
19- colorScheme : Colors = MiuixTheme .colorScheme,
19+ colors : Colors = MiuixTheme .colorScheme,
2020 textStyles : TextStyles = MiuixTheme .textStyles,
2121 content : @Composable () -> Unit
2222) {
23- val miuixColors = remember { colorScheme.copy() }.apply { updateColorsFrom(colorScheme) }
24- val miuixTextStyles = remember(colorScheme.onBackground) {
25- defaultTextStyles(
26- main = textStyles.main.copy(color = colorScheme.onBackground),
27- title = textStyles.title.copy(color = colorScheme.onBackground),
28- paragraph = textStyles.paragraph.copy(color = colorScheme.onBackground),
29- body1 = textStyles.body1.copy(color = colorScheme.onBackground),
30- body2 = textStyles.body2.copy(color = colorScheme.onBackground),
31- button = textStyles.button.copy(color = colorScheme.onBackground),
32- footnote1 = textStyles.footnote1.copy(color = colorScheme.onBackground),
33- footnote2 = textStyles.footnote2.copy(color = colorScheme.onBackground),
34- headline1 = textStyles.headline1.copy(color = colorScheme.onBackground),
35- headline2 = textStyles.headline2.copy(color = colorScheme.onBackground),
36- subtitle = textStyles.subtitle.copy(color = colorScheme.onBackground),
37- title1 = textStyles.title1.copy(color = colorScheme.onBackground),
38- title2 = textStyles.title2.copy(color = colorScheme.onBackground),
39- title3 = textStyles.title3.copy(color = colorScheme.onBackground),
40- title4 = textStyles.title4.copy(color = colorScheme.onBackground)
41- )
23+ val miuixColors = remember { colors.copy() }.apply {
24+ updateColorsFrom(colors)
4225 }
43- val miuixRipple = remember(colorScheme.onBackground) {
44- MiuixIndication (backgroundColor = colorScheme.onBackground)
26+ val miuixTextStyles = remember { textStyles }
27+ val miuixIndication = remember(colors.onBackground) {
28+ MiuixIndication (backgroundColor = colors.onBackground)
4529 }
4630 CompositionLocalProvider (
4731 LocalColors provides miuixColors,
4832 LocalTextStyles provides miuixTextStyles,
49- LocalIndication provides miuixRipple
33+ LocalIndication provides miuixIndication
5034 ) {
5135 content()
5236 }
0 commit comments