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

[TnT-64] 디자인 시스템 구현 #11

Merged
merged 5 commits into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
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
119 changes: 119 additions & 0 deletions core/designsystem/src/main/java/co/kr/tnt/designsystem/theme/Color.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,122 @@ val Pink80 = Color(0xFFEFB8C8)
val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)

// Main color
val Red_950 = Color(0xFF450A0A)
val Red_900 = Color(0xFF7F1D1D)
val Red_800 = Color(0xFF991B1B)
val Red_700 = Color(0xFFB91C1C)
val Red_600 = Color(0xFFDC2626)
val Red_500 = Color(0xFFEF4444)
val Red_400 = Color(0xFFF87171)
val Red_300 = Color(0xFFFCA5A5)
val Red_200 = Color(0xFFFECACA)
val Red_100 = Color(0xFFFEE2E2)

// Green Color
val Green_950 = Color(0xFF00240C)
val Green_900 = Color(0xFF004517)
val Green_800 = Color(0xFF006E25)
val Green_700 = Color(0xFF009632)
val Green_600 = Color(0xFF00BF40)
val Green_500 = Color(0xFF1ED45A)
val Green_400 = Color(0xFF49E57D)
val Green_300 = Color(0xFF7DF5A5)
val Green_200 = Color(0xFFACFCC7)
val Green_100 = Color(0xFFD9FFE6)

// Orange Color
val Orange_950 = Color(0xFF361E00)
val Orange_900 = Color(0xFF663A00)
val Orange_800 = Color(0xFF9C5800)
val Orange_700 = Color(0xFFD47800)
val Orange_600 = Color(0xFFFF9200)
val Orange_500 = Color(0xFFFFA938)
val Orange_400 = Color(0xFFFFC06E)
val Orange_300 = Color(0xFFFFD49C)
val Orange_200 = Color(0xFFFEE6C6)
val Orange_100 = Color(0xFFFEF4E6)
val Orange_50 = Color(0xFFFFFCF7)

// Lime Color
val Lime_950 = Color(0xFF112900)
val Lime_900 = Color(0xFF225200)
val Lime_800 = Color(0xFF347D00)
val Lime_700 = Color(0xFF48AD00)
val Lime_600 = Color(0xFF58CF04)
val Lime_500 = Color(0xFF6BE016)
val Lime_400 = Color(0xFF88F03E)
val Lime_300 = Color(0xFFAEF779)
val Lime_200 = Color(0xFFCCFCA9)
val Lime_100 = Color(0xFFE6FFD4)
val Lime_50 = Color(0xFFF8FFF2)

// Blue Color
val Blue_950 = Color(0xFF002130)
val Blue_900 = Color(0xFF004261)
val Blue_800 = Color(0xFF006796)
val Blue_700 = Color(0xFF008DCF)
val Blue_600 = Color(0xFF00AEFF)
val Blue_500 = Color(0xFF3DC2FF)
val Blue_400 = Color(0xFF70D2FF)
val Blue_300 = Color(0xFFA1E1FF)
val Blue_200 = Color(0xFFC4ECFE)
val Blue_100 = Color(0xFFE5F6FE)
val Blue_50 = Color(0xFFF7FDFF)

// Violet Color
val Violet_950 = Color(0xFF11024D)
val Violet_900 = Color(0xFF23098F)
val Violet_800 = Color(0xFF3A16C9)
val Violet_700 = Color(0xFF4F29E5)
val Violet_600 = Color(0xFF6541F2)
val Violet_500 = Color(0xFF7D5EF7)
val Violet_400 = Color(0xFF9E86FC)
val Violet_300 = Color(0xFFC0B0FF)
val Violet_200 = Color(0xFFDBD3FE)
val Violet_100 = Color(0xFFF0ECFE)
val Violet_50 = Color(0xFFFBFAFF)

// Purple Color
val Purple_950 = Color(0xFF290247)
val Purple_900 = Color(0xFF580A7D)
val Purple_800 = Color(0xFF861CB8)
val Purple_700 = Color(0xFFAD36E3)
val Purple_600 = Color(0xFFCB59FF)
val Purple_500 = Color(0xFFD478FF)
val Purple_400 = Color(0xFFDE96FF)
val Purple_300 = Color(0xFFE9BAFF)
val Purple_200 = Color(0xFFF2D6FF)
val Purple_100 = Color(0xFFF9EDFF)
val Purple_50 = Color(0xFFFEFBFF)

// Pink Color
val Pink_950 = Color(0xFF3D0133)
val Pink_900 = Color(0xFF730560)
val Pink_800 = Color(0xFFA81690)
val Pink_700 = Color(0xFFD331B8)
val Pink_600 = Color(0xFFF553DA)
val Pink_500 = Color(0xFFFA73E3)
val Pink_400 = Color(0xFFFF94ED)
val Pink_300 = Color(0xFFFFB8F3)
val Pink_200 = Color(0xFFFED3F7)
val Pink_100 = Color(0xFFFEECFB)
val Pink_50 = Color(0xFFFFFAFE)

// Neutral Color
val Neutral_950 = Color(0xFF0A0A0A)
val Neutral_900 = Color(0xFF171717)
val Neutral_800 = Color(0xFF262626)
val Neutral_700 = Color(0xFF404040)
val Neutral_600 = Color(0xFF525252)
val Neutral_500 = Color(0xFF737373)
val Neutral_400 = Color(0xFFA3A3A3)
val Neutral_300 = Color(0xFFD4D4D4)
val Neutral_200 = Color(0xFFE5E5E5)
val Neutral_100 = Color(0xFFF5F5F5)
val Neutral_50 = Color(0xFFFAFAFA)

// Common Color
val Common_100 = Color(0xFF000000)
val Common_0 = Color(0xFFFFFFFF)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.platform.LocalContext

private val DarkColorScheme = darkColorScheme(
Expand Down Expand Up @@ -48,9 +49,18 @@ fun TnTTheme(
else -> LightColorScheme
}

MaterialTheme(
colorScheme = colorScheme,
typography = Typography,
content = content,
)
CompositionLocalProvider(
LocalTypography provides Typography,
) {
MaterialTheme(
colorScheme = colorScheme,
content = content,
)
}
}

object TnTTheme {
val typography: TnTTypography
@Composable
get() = LocalTypography.current
}
134 changes: 111 additions & 23 deletions core/designsystem/src/main/java/co/kr/tnt/designsystem/theme/Type.kt
Original file line number Diff line number Diff line change
@@ -1,34 +1,122 @@
package co.kr.tnt.designsystem.theme

import androidx.compose.material3.Typography
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
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.unit.sp
import co.kr.tnt.core.designsystem.R

val Pretendard = FontFamily(
Font(R.font.pretendard_bold, FontWeight.Bold),
Font(R.font.pretendard_semibold, FontWeight.SemiBold),
Font(R.font.pretendard_medium, FontWeight.Medium),
Font(R.font.pretendard_regular, FontWeight.Normal),
)

private val PretendardStyle = TextStyle(
fontFamily = Pretendard,
)

// Set of Material typography styles to start with
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
internal val Typography = TnTTypography(
h1 = PretendardStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 28.sp,
lineHeight = (28 * 1.5).sp,
letterSpacing = (28 * -0.02).sp,
),
h2 = PretendardStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 24.sp,
lineHeight = (24 * 1.5).sp,
letterSpacing = (24 * -0.02).sp,
),
h3 = PretendardStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 20.sp,
lineHeight = (20 * 1.5).sp,
letterSpacing = (20 * -0.02).sp,
),
h4 = PretendardStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 18.sp,
lineHeight = (18 * 1.5).sp,
letterSpacing = (18 * -0.02).sp,
),
body1Normal = PretendardStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 28.sp,
lineHeight = (28 * 1.5).sp,
letterSpacing = (28 * -0.02).sp,
),
body1Reading = PretendardStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 16.sp,
lineHeight = 24.sp,
letterSpacing = 0.5.sp,
),
/* Other default text styles to override
titleLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp
),
labelSmall = TextStyle(
fontFamily = FontFamily.Default,
lineHeight = (16 * 1.6).sp,
letterSpacing = (16 * -0.02).sp,
),
body2Normal = PretendardStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 11.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp
)
*/
fontSize = 15.sp,
lineHeight = (15 * 1.5).sp,
letterSpacing = (15 * -0.02).sp,
),
body2Reading = PretendardStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 15.sp,
lineHeight = (15 * 1.6).sp,
letterSpacing = (15 * -0.02).sp,
),
label1Normal = PretendardStyle.copy(
fontWeight = FontWeight.Bold,
fontSize = 13.sp,
lineHeight = (13 * 1.3).sp,
letterSpacing = (13 * -0.02).sp,
),
label1Reading = PretendardStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 13.sp,
lineHeight = (13 * 1.5).sp,
letterSpacing = (13 * -0.02).sp,
),
caption1 = PretendardStyle.copy(
fontWeight = FontWeight.Medium,
fontSize = 12.sp,
lineHeight = (12 * 1.3).sp,
letterSpacing = (12 * -0.02).sp,
),
)

@Immutable
data class TnTTypography(
val h1: TextStyle,
val h2: TextStyle,
val h3: TextStyle,
val h4: TextStyle,
val body1Normal: TextStyle,
val body1Reading: TextStyle,
val body2Normal: TextStyle,
val body2Reading: TextStyle,
val label1Normal: TextStyle,
val label1Reading: TextStyle,
val caption1: TextStyle,
)

val LocalTypography = staticCompositionLocalOf {
TnTTypography(
h1 = PretendardStyle,
h2 = PretendardStyle,
h3 = PretendardStyle,
h4 = PretendardStyle,
body1Normal = PretendardStyle,
body1Reading = PretendardStyle,
body2Normal = PretendardStyle,
body2Reading = PretendardStyle,
label1Normal = PretendardStyle,
label1Reading = PretendardStyle,
caption1 = PretendardStyle,
)
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading