Hi all, where is the MaterialTheme settings in a c...
# compose-web
s
Hi all, where is the MaterialTheme settings in a compose web (only web, no android/desktop/iOS)? I will add some customizations as font colors for typography, thank you in advance!
a
Hi, as far as I know, there is no API to customize colors/typography only for certain platform. What you can do, is to declare your typography/colors as expect declarations and actualize them differently for different platforms. As for example:
Copy code
// commonMain/App.kt
@Composable
fun App() {
  MaterialTheme(colors = themeColors) { ... }
}

// commonMain/theme/colors.kt
expect val themeColors: Colors

// androidMain/theme/colors.android.kt
actual val themeColors = darkColors()

// iosMain/theme/colors.ios.kt
actual val themeColors = darkColors()

// wasmJsMain/theme/colors.wasm.kt
actual val themeColors = darkColors(
  primary = white
)
s
Thank you Artem
a
You are welcome 🫡