From 23bb809d02951c110bed57e0fbdb256d9cf40ad9 Mon Sep 17 00:00:00 2001 From: jinukeu Date: Mon, 11 Dec 2023 14:59:52 +0900 Subject: [PATCH] =?UTF-8?q?feat/#36:=20Theme=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../suwiki/core/designsystem/theme/Theme.kt | 30 +++++++++++++++++++ .../core/designsystem/theme/Typography.kt | 27 +++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 core/designsystem/src/main/java/com/suwiki/core/designsystem/theme/Theme.kt diff --git a/core/designsystem/src/main/java/com/suwiki/core/designsystem/theme/Theme.kt b/core/designsystem/src/main/java/com/suwiki/core/designsystem/theme/Theme.kt new file mode 100644 index 000000000..4cec295ae --- /dev/null +++ b/core/designsystem/src/main/java/com/suwiki/core/designsystem/theme/Theme.kt @@ -0,0 +1,30 @@ +package com.suwiki.core.designsystem.theme + +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.ReadOnlyComposable + +@Composable +fun SuwikiTheme( + content: @Composable () -> Unit, +) { + CompositionLocalProvider( + LocalTypography provides Typography, + ) { + MaterialTheme( + colorScheme = lightColorScheme( + background = GrayFB, + ), + content = content, + ) + } +} + +object SuwikiTheme { + val typography: SuwikiTypography + @Composable + @ReadOnlyComposable + get() = LocalTypography.current +} diff --git a/core/designsystem/src/main/java/com/suwiki/core/designsystem/theme/Typography.kt b/core/designsystem/src/main/java/com/suwiki/core/designsystem/theme/Typography.kt index fc180551f..f44951ce8 100644 --- a/core/designsystem/src/main/java/com/suwiki/core/designsystem/theme/Typography.kt +++ b/core/designsystem/src/main/java/com/suwiki/core/designsystem/theme/Typography.kt @@ -1,6 +1,7 @@ package com.suwiki.core.designsystem.theme import androidx.compose.runtime.Immutable +import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.text.PlatformTextStyle import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.Font @@ -145,3 +146,29 @@ data class SuwikiTypography( val caption6: TextStyle, val caption7: TextStyle, ) + +val LocalTypography = staticCompositionLocalOf { + SuwikiTypography( + header1 = notoSansStyle, + header2 = notoSansStyle, + header3 = notoSansStyle, + header4 = notoSansStyle, + header5 = notoSansStyle, + header6 = notoSansStyle, + header7 = notoSansStyle, + body1 = notoSansStyle, + body2 = notoSansStyle, + body3 = notoSansStyle, + body4 = notoSansStyle, + body5 = notoSansStyle, + body6 = notoSansStyle, + body7 = notoSansStyle, + caption1 = notoSansStyle, + caption2 = notoSansStyle, + caption3 = notoSansStyle, + caption4 = notoSansStyle, + caption5 = notoSansStyle, + caption6 = notoSansStyle, + caption7 = notoSansStyle, + ) +}