Skip to content

Commit

Permalink
feat/#36: Theme 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jinukeu committed Dec 11, 2023
1 parent 16ee461 commit 23bb809
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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,
)
}

0 comments on commit 23bb809

Please sign in to comment.