Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking โ€œSign up for GitHubโ€, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#36 theme #50

Merged
merged 5 commits into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.suwiki.core.designsystem.theme

import androidx.compose.ui.graphics.Color

val Primary = Color(0xFF346CFD)

val Black = Color(0xFF222222)
val White = Color(0xFFFFFFFF)

val Error = Color(0xFFF05C2E)

val Blue100 = Color(0xFF3D4EFB)
val Blue30 = Color(0xFFC5CAFE)
val Blue10 = Color(0xFFECEDFF)
val Blue5 = Color(0xFFF5F8FF)

val Green100 = Color(0xFF2DB942)
val Green30 = Color(0xFFC0EAC6)
val Green10 = Color(0xFFEAF8EC)

val Orange100 = Color(0xFFFD873B)
val Orange30 = Color(0xFFFEDBC4)
val Orange10 = Color(0xFFFFF3EB)

val Gray6A = Color(0xFF6A6A6A)
val Gray95 = Color(0xFF959595)
val GrayCB = Color(0xFFCBCBCB)
val GrayDA = Color(0xFFDADADA)
val GrayF6 = Color(0xFFF6F6F6)
val GrayFB = Color(0xFFFBFBFB)
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
@@ -0,0 +1,174 @@
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
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.LineHeightStyle
import androidx.compose.ui.unit.em
import androidx.compose.ui.unit.sp
import com.suwiki.core.designsystem.R

internal val notoSansFamily = FontFamily(
Font(R.font.notosanskrbold, FontWeight.Bold),
Font(R.font.notosanskrmedium, FontWeight.Medium),
Font(R.font.notosanskrregular, FontWeight.Normal),
Font(R.font.notosanskrlight, FontWeight.Light),
)

private val notoSansStyle = TextStyle(
fontFamily = notoSansFamily,
lineHeight = 1.5.em,
platformStyle = PlatformTextStyle(
includeFontPadding = false,
),
lineHeightStyle = LineHeightStyle(
alignment = LineHeightStyle.Alignment.Center,
trim = LineHeightStyle.Trim.None,
),
)

internal val Typography = SuwikiTypography(
header1 = notoSansStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 22.sp,
),
header2 = notoSansStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 18.sp,
),
header3 = notoSansStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 18.sp,
),
header4 = notoSansStyle.copy(
fontWeight = FontWeight.Normal,
fontSize = 18.sp,
),
header5 = notoSansStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 16.sp,
),
header6 = notoSansStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 16.sp,
),
header7 = notoSansStyle.copy(
fontWeight = FontWeight.Normal,
fontSize = 16.sp,
),

body1 = notoSansStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 15.sp,
),
body2 = notoSansStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 15.sp,
),
body3 = notoSansStyle.copy(
fontWeight = FontWeight.Normal,
fontSize = 15.sp,
),
body4 = notoSansStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 14.sp,
),
body5 = notoSansStyle.copy(
fontWeight = FontWeight.Normal,
fontSize = 14.sp,
),
body6 = notoSansStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 13.sp,
),
body7 = notoSansStyle.copy(
fontWeight = FontWeight.Normal,
fontSize = 13.sp,
),

caption1 = notoSansStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 12.sp,
),
caption2 = notoSansStyle.copy(
fontWeight = FontWeight.Normal,
fontSize = 12.sp,
),
caption3 = notoSansStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 11.sp,
),
caption4 = notoSansStyle.copy(
fontWeight = FontWeight.Normal,
fontSize = 11.sp,
),
caption5 = notoSansStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 10.sp,
),
caption6 = notoSansStyle.copy(
fontWeight = FontWeight.Normal,
fontSize = 10.sp,
),
caption7 = notoSansStyle.copy(
fontWeight = FontWeight.Normal,
fontSize = 8.sp,
),
)

@Immutable
data class SuwikiTypography(
val header1: TextStyle,
val header2: TextStyle,
val header3: TextStyle,
val header4: TextStyle,
val header5: TextStyle,
val header6: TextStyle,
val header7: TextStyle,

val body1: TextStyle,
val body2: TextStyle,
val body3: TextStyle,
val body4: TextStyle,
val body5: TextStyle,
val body6: TextStyle,
val body7: TextStyle,

val caption1: TextStyle,
val caption2: TextStyle,
val caption3: TextStyle,
val caption4: TextStyle,
val caption5: TextStyle,
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,
)
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.