-
Notifications
You must be signed in to change notification settings - Fork 0
[setting/#7] design system #8
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,111 @@ | ||
| package com.hsLink.hslink.core.designsystem.theme | ||
|
|
||
| import androidx.compose.runtime.Immutable | ||
| import androidx.compose.runtime.staticCompositionLocalOf | ||
| import androidx.compose.ui.graphics.Color | ||
|
|
||
| val Purple80 = Color(0xFFD0BCFF) | ||
| val PurpleGrey80 = Color(0xFFCCC2DC) | ||
| val Pink80 = Color(0xFFEFB8C8) | ||
|
|
||
| val Purple40 = Color(0xFF6650a4) | ||
| val PurpleGrey40 = Color(0xFF625b71) | ||
| val Pink40 = Color(0xFF7D5260) | ||
| val Common = Color(0xFFFFFFFF) | ||
|
|
||
| val Transparent = Color(0xFF2D2D2D) | ||
|
|
||
| val SkyBlue100 = Color(0xFFEFF8FC) | ||
| val SkyBlue200 = Color(0xFFD7EEFB) | ||
| val SkyBlue300 = Color(0xFFA4D4F0) | ||
| val SkyBlue400 = Color(0xFF7DC2E9) | ||
| val SkyBlue500 = Color(0xFF62B5E5) | ||
| val SkyBlue600 = Color(0xFF457FA0) | ||
| val SkyBlue700 = Color(0xFF225370) | ||
|
|
||
| val DeepBlue100 = Color(0xFFE6EDF8) | ||
| val DeepBlue200 = Color(0xFFB2CEFA) | ||
| val DeepBlue300 = Color(0xFF6B94D8) | ||
| val DeepBlue400 = Color(0xFF2B66C7) | ||
| val DeepBlue500 = Color(0xFF0047BB) | ||
| val DeepBlue600 = Color(0xFF003283) | ||
| val DeepBlue700 = Color(0xFF071F46) | ||
|
|
||
| val Grey100 = Color(0xFFEEEEEF) | ||
| val Grey200 = Color(0xFFD1D2D4) | ||
| val Grey300 = Color(0xFF9C9D9F) | ||
| val Grey400 = Color(0xFF717376) | ||
| val Grey500 = Color(0xFF54565A) | ||
| val Grey600 = Color(0xFF3B3C3F) | ||
| val Grey700 = Color(0xFF2D2D30) | ||
|
|
||
| val Red100 = Color(0xFFFCEBEB) | ||
| val Red200 = Color(0xFFFFC9C8) | ||
| val Red300 = Color(0xFFF08C8A) | ||
| val Red400 = Color(0xFFE95B57) | ||
| val Red500 = Color(0xFFE53935) | ||
| val Red600 = Color(0xFFA02825) | ||
| val Red700 = Color(0xFF651513) | ||
|
|
||
| @Immutable | ||
| data class HsLinkColor( | ||
| val Common: Color, | ||
| val Transparent: Color, | ||
| val SkyBlue100: Color, | ||
| val SkyBlue200: Color, | ||
| val SkyBlue300: Color, | ||
| val SkyBlue400: Color, | ||
| val SkyBlue500: Color, | ||
| val SkyBlue600: Color, | ||
| val SkyBlue700: Color, | ||
| val DeepBlue100: Color, | ||
| val DeepBlue200: Color, | ||
| val DeepBlue300: Color, | ||
| val DeepBlue400: Color, | ||
| val DeepBlue500: Color, | ||
| val DeepBlue600: Color, | ||
| val DeepBlue700: Color, | ||
| val Grey100: Color, | ||
| val Grey200: Color, | ||
| val Grey300: Color, | ||
| val Grey400: Color, | ||
| val Grey500: Color, | ||
| val Grey600: Color, | ||
| val Grey700: Color, | ||
| val Red100: Color, | ||
| val Red200: Color, | ||
| val Red300: Color, | ||
| val Red400: Color, | ||
| val Red500: Color, | ||
| val Red600: Color, | ||
| val Red700: Color, | ||
| ) | ||
|
|
||
| val defaultHsLinkColor = HsLinkColor( | ||
| Common = Common, | ||
| Transparent = Transparent, | ||
| SkyBlue100 = SkyBlue100, | ||
| SkyBlue200 = SkyBlue200, | ||
| SkyBlue300 = SkyBlue300, | ||
| SkyBlue400 = SkyBlue400, | ||
| SkyBlue500 = SkyBlue500, | ||
| SkyBlue600 = SkyBlue600, | ||
| SkyBlue700 = SkyBlue700, | ||
| DeepBlue100 = DeepBlue100, | ||
| DeepBlue200 = DeepBlue200, | ||
| DeepBlue300 = DeepBlue300, | ||
| DeepBlue400 = DeepBlue400, | ||
| DeepBlue500 = DeepBlue500, | ||
| DeepBlue600 = DeepBlue600, | ||
| DeepBlue700 = DeepBlue700, | ||
| Grey100 = Grey100, | ||
| Grey200 = Grey200, | ||
| Grey300 = Grey300, | ||
| Grey400 = Grey400, | ||
| Grey500 = Grey500, | ||
| Grey600 = Grey600, | ||
| Grey700 = Grey700, | ||
| Red100 = Red100, | ||
| Red200 = Red200, | ||
| Red300 = Red300, | ||
| Red400 = Red400, | ||
| Red500 = Red500, | ||
| Red600 = Red600, | ||
| Red700 = Red700 | ||
| ) | ||
|
|
||
| val LocalHsLinkColors = staticCompositionLocalOf { defaultHsLinkColor } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,57 +1,57 @@ | ||
| package com.hsLink.hslink.core.designsystem.theme | ||
|
|
||
| import android.os.Build | ||
| import androidx.compose.foundation.isSystemInDarkTheme | ||
| import android.app.Activity | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.darkColorScheme | ||
| import androidx.compose.material3.dynamicDarkColorScheme | ||
| import androidx.compose.material3.dynamicLightColorScheme | ||
| import androidx.compose.material3.lightColorScheme | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.platform.LocalContext | ||
| import androidx.compose.runtime.CompositionLocalProvider | ||
| import androidx.compose.runtime.ReadOnlyComposable | ||
| import androidx.compose.runtime.SideEffect | ||
| import androidx.compose.ui.platform.LocalView | ||
| import androidx.core.view.WindowCompat | ||
|
|
||
| private val DarkColorScheme = darkColorScheme( | ||
| primary = Purple80, | ||
| secondary = PurpleGrey80, | ||
| tertiary = Pink80 | ||
| ) | ||
| object HsLinkTheme { | ||
| val colors: HsLinkColor | ||
| @Composable | ||
| @ReadOnlyComposable | ||
| get() = LocalHsLinkColors.current | ||
|
|
||
| private val LightColorScheme = lightColorScheme( | ||
| primary = Purple40, | ||
| secondary = PurpleGrey40, | ||
| tertiary = Pink40 | ||
| val typography: HsLinkTypography | ||
| @Composable | ||
| @ReadOnlyComposable | ||
| get() = LocalHsLinkTypography.current | ||
| } | ||
|
|
||
| /* Other default colors to override | ||
| background = Color(0xFFFFFBFE), | ||
| surface = Color(0xFFFFFBFE), | ||
| onPrimary = Color.White, | ||
| onSecondary = Color.White, | ||
| onTertiary = Color.White, | ||
| onBackground = Color(0xFF1C1B1F), | ||
| onSurface = Color(0xFF1C1B1F), | ||
| */ | ||
| ) | ||
| @Composable | ||
| fun ProvideHsLinkColorsAndTypography( | ||
| colors: HsLinkColor, | ||
| typography: HsLinkTypography, | ||
| content: @Composable () -> Unit, | ||
| ) { | ||
| CompositionLocalProvider( | ||
| LocalHsLinkColors provides colors, | ||
| LocalHsLinkTypography provides typography, | ||
| content = content | ||
| ) | ||
| } | ||
|
|
||
| @Composable | ||
| fun HsLinkTheme( | ||
| darkTheme: Boolean = isSystemInDarkTheme(), | ||
| // Dynamic color is available on Android 12+ | ||
| dynamicColor: Boolean = true, | ||
| content: @Composable () -> Unit | ||
| content: @Composable () -> Unit, | ||
| ) { | ||
| val colorScheme = when { | ||
| dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { | ||
| val context = LocalContext.current | ||
| if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) | ||
| ProvideHsLinkColorsAndTypography( | ||
| colors = defaultHsLinkColor, | ||
| typography = defaultHsLinkTypography | ||
| ) { | ||
| val view = LocalView.current | ||
| if (!view.isInEditMode) { | ||
| SideEffect { | ||
| (view.context as Activity).window.run { | ||
| WindowCompat.getInsetsController(this, view).isAppearanceLightStatusBars = false | ||
| } | ||
| } | ||
|
Comment on lines
+45
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Status bar icon contrast is inverted for a light UI. Setting - WindowCompat.getInsetsController(this, view).isAppearanceLightStatusBars = false
+ // For light background (e.g., white), use dark icons:
+ WindowCompat.getInsetsController(this, view).isAppearanceLightStatusBars = true🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| darkTheme -> DarkColorScheme | ||
| else -> LightColorScheme | ||
| MaterialTheme( | ||
| content = content | ||
| ) | ||
| } | ||
|
|
||
| MaterialTheme( | ||
| colorScheme = colorScheme, | ||
| typography = Typography, | ||
| content = content | ||
| ) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,128 @@ | ||
| package com.hsLink.hslink.core.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.em | ||
| import androidx.compose.ui.unit.sp | ||
| import com.hsLink.hslink.R | ||
|
|
||
| // Set of Material typography styles to start with | ||
| val Typography = Typography( | ||
| bodyLarge = TextStyle( | ||
| fontFamily = FontFamily.Default, | ||
| val HsLinkSemiBoldFont = FontFamily(Font(R.font.pretendard_semibold)) | ||
| val HsLinkRegularFont = FontFamily(Font(R.font.pretendard_regular)) | ||
| val HsLinkMediumFont = FontFamily(Font(R.font.pretendard_medium)) | ||
|
Comment on lines
+13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify font resources exist (pretendard_*). Ensure 🏁 Script executed: #!/bin/bash
# List expected font files and confirm references.
fd -a -t f 'res/font/pretendard_*' || true
rg -nP 'R\.font\.pretendard_(semibold|regular|medium)' -g '!**/build/**' -SLength of output: 416 Missing font resource files will cause build failures. The code references
🤖 Prompt for AI Agents |
||
|
|
||
| @Immutable | ||
| data class HsLinkTypography( | ||
| val title_24Strong: TextStyle, | ||
| val title_20Strong: TextStyle, | ||
| val title_16Strong: TextStyle, | ||
| val title_14Strong: TextStyle, | ||
|
|
||
| val body_16Strong: TextStyle, | ||
| val body_16Normal: TextStyle, | ||
| val body_14Normal: TextStyle, | ||
|
|
||
| val caption_14Normal: TextStyle, | ||
| val caption_12Normal: TextStyle, | ||
|
|
||
| val btm_L: TextStyle, | ||
| val btm_M: TextStyle, | ||
| val btm_S: TextStyle, | ||
| ) | ||
|
|
||
| val defaultHsLinkTypography = HsLinkTypography( | ||
|
|
||
| title_24Strong = TextStyle( | ||
| fontFamily = HsLinkSemiBoldFont, | ||
| fontWeight = FontWeight.SemiBold, | ||
| fontSize = 24.sp, | ||
| lineHeight = 34.sp, | ||
| letterSpacing = (-0.03).em | ||
| ), | ||
| title_20Strong = TextStyle( | ||
| fontFamily = HsLinkSemiBoldFont, | ||
| fontWeight = FontWeight.SemiBold, | ||
| fontSize = 20.sp, | ||
| lineHeight = 28.sp, | ||
| letterSpacing = (-0.03).em | ||
| ), | ||
|
|
||
| title_16Strong = TextStyle( | ||
| fontFamily = HsLinkSemiBoldFont, | ||
| fontWeight = FontWeight.SemiBold, | ||
| fontSize = 16.sp, | ||
| lineHeight = 22.sp, | ||
| letterSpacing = (-0.02).em | ||
| ), | ||
| title_14Strong = TextStyle( | ||
| fontFamily = HsLinkMediumFont, | ||
| fontWeight = FontWeight.Medium, | ||
| fontSize = 14.sp, | ||
| lineHeight = 20.sp, | ||
| letterSpacing = (-0.02).em | ||
| ), | ||
|
|
||
| body_16Strong = TextStyle( | ||
| fontFamily = HsLinkMediumFont, | ||
| fontWeight = FontWeight.Medium, | ||
| fontSize = 16.sp, | ||
| lineHeight = 22.sp, | ||
| letterSpacing = (-0.02).em | ||
| ), | ||
| body_16Normal = TextStyle( | ||
| fontFamily = HsLinkRegularFont, | ||
| fontWeight = FontWeight.Normal, | ||
| fontSize = 16.sp, | ||
| lineHeight = 24.sp, | ||
| letterSpacing = 0.5.sp | ||
| ) | ||
| /* Other default text styles to override | ||
| titleLarge = TextStyle( | ||
| fontFamily = FontFamily.Default, | ||
| lineHeight = 22.sp, | ||
| letterSpacing = (-0.02).em | ||
| ), | ||
| body_14Normal = TextStyle( | ||
| fontFamily = HsLinkRegularFont, | ||
| fontWeight = FontWeight.Normal, | ||
| fontSize = 22.sp, | ||
| lineHeight = 28.sp, | ||
| letterSpacing = 0.sp | ||
| fontSize = 14.sp, | ||
| lineHeight = 20.sp, | ||
| letterSpacing = (-0.02).em | ||
| ), | ||
| labelSmall = TextStyle( | ||
| fontFamily = FontFamily.Default, | ||
| fontWeight = FontWeight.Medium, | ||
| fontSize = 11.sp, | ||
|
|
||
| caption_14Normal = TextStyle( | ||
| fontFamily = HsLinkRegularFont, | ||
| fontWeight = FontWeight.Normal, | ||
| fontSize = 14.sp, | ||
| lineHeight = 20.sp, | ||
| letterSpacing = (-0.02).em | ||
| ), | ||
| caption_12Normal = TextStyle( | ||
| fontFamily = HsLinkRegularFont, | ||
| fontWeight = FontWeight.Normal, | ||
| fontSize = 12.sp, | ||
| lineHeight = 16.sp, | ||
| letterSpacing = 0.5.sp | ||
| letterSpacing = (-0.02).em | ||
| ), | ||
|
|
||
| btm_L = TextStyle( | ||
| fontFamily = HsLinkSemiBoldFont, | ||
| fontWeight = FontWeight.SemiBold, | ||
| fontSize = 18.sp, | ||
| lineHeight = 24.sp, | ||
| letterSpacing = (-0.02).em | ||
| ), | ||
| btm_M = TextStyle( | ||
| fontFamily = HsLinkSemiBoldFont, | ||
| fontWeight = FontWeight.SemiBold, | ||
| fontSize = 16.sp, | ||
| lineHeight = 22.sp, | ||
| letterSpacing = (-0.02).em | ||
| ), | ||
| btm_S = TextStyle( | ||
| fontFamily = HsLinkSemiBoldFont, | ||
| fontWeight = FontWeight.SemiBold, | ||
| fontSize = 12.sp, | ||
| lineHeight = 16.sp, | ||
| letterSpacing = (-0.02).em | ||
| ) | ||
| */ | ||
| ) | ||
| ) | ||
|
|
||
| val LocalHsLinkTypography = staticCompositionLocalOf { defaultHsLinkTypography } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Transparent" is opaque (#2D2D2D); make it truly transparent.
Use 0x00000000 (or Color.Transparent) to avoid unexpected opaque backgrounds.
📝 Committable suggestion
🤖 Prompt for AI Agents