From 50efcc1bfba1a659da96f83bdac0b1d1e39b35af Mon Sep 17 00:00:00 2001 From: ganfra Date: Mon, 21 Nov 2022 17:56:33 +0100 Subject: [PATCH] Try to map some theming colors/font but it makes no sense at the moment --- .../element/android/x/designsystem/Color.kt | 25 ++- .../element/android/x/designsystem/Theme.kt | 4 +- .../io/element/android/x/designsystem/Type.kt | 192 +++++++++++++++++- 3 files changed, 214 insertions(+), 7 deletions(-) diff --git a/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Color.kt b/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Color.kt index cee52b821e..53126611dc 100644 --- a/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Color.kt +++ b/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Color.kt @@ -8,5 +8,26 @@ val DarkGrey = Color(0x99EBEBF5) val AvatarGradientStart = Color(0xFF4CA1AF) val AvatarGradientEnd = Color(0xFFC4E0E5) -val SystemGreyLight = Color(0xFFE5E5EA) -val SystemGreyDark = Color(0xFF1C1C1E) \ No newline at end of file +val SystemGreyLight = Color(0xFF8E8E93) +val SystemGreyDark = Color(0xFF8E8E93) +val SystemGrey2Light = Color(0xFFAEAEB2) +val SystemGrey2Dark = Color(0xFF636366) +val SystemGrey3Light = Color(0xFFC7C7CC) +val SystemGrey3Dark = Color(0xFF48484A) +val SystemGrey4Light = Color(0xFFD1D1D6) +val SystemGrey4Dark = Color(0xFF3A3A3C) +val SystemGrey5Light = Color(0xFFE5E5EA) +val SystemGrey5Dark = Color(0xFF2C2C2E) +val SystemGrey6Light = Color(0xFFF2F2F7) +val SystemGrey6Dark = Color(0xFF1C1C1E) + +val Azure = Color(0xFF368BD6) +val Kiwi = Color(0xFF74D12C) +val Grape = Color(0xFFAC3BA8) +val Verde = Color(0xFF03B381) +val Polly = Color(0xFFE64F7A) +val Melon = Color(0xFFFF812D) + +val ElementGreen = Color(0xFF0DBD8B) +val ElementOrange = Color(0xFFD9B072) +val Vermilion = Color(0xFFFF5B55) diff --git a/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Theme.kt b/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Theme.kt index 7e520806fe..81b8d2f7f0 100644 --- a/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Theme.kt +++ b/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Theme.kt @@ -16,7 +16,7 @@ private val DarkColorScheme = darkColorScheme( background = Color.Black, onBackground = Color.White, surface = Color.Black, - surfaceVariant = SystemGreyDark, + surfaceVariant = SystemGrey6Dark, onSurface = Color.White, onSurfaceVariant = Color.White, ) @@ -28,7 +28,7 @@ private val LightColorScheme = lightColorScheme( background = Color.White, onBackground = Color.Black, surface = Color.White, - surfaceVariant = SystemGreyLight, + surfaceVariant = SystemGrey6Light, onSurface = Color.Black, onSurfaceVariant = Color.Black, diff --git a/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Type.kt b/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Type.kt index 37f0303aff..233bdbe98f 100644 --- a/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Type.kt +++ b/libraries/designsystem/src/main/java/io/element/android/x/designsystem/Type.kt @@ -3,7 +3,9 @@ package io.element.android.x.designsystem import androidx.compose.material3.Typography import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.sp // Set of Material typography styles to start with @@ -22,8 +24,7 @@ val Typography = Typography( fontSize = 32.sp, lineHeight = 24.sp, letterSpacing = 0.5.sp - ) - + ), /* Other default text styles to override titleLarge = TextStyle( fontFamily = FontFamily.Default, @@ -40,4 +41,189 @@ val Typography = Typography( letterSpacing = 0.5.sp ) */ -) \ No newline at end of file +) + +object ElementTextStyles { + + object Bold { + val largeTitle = TextStyle( + fontSize = 34.sp, + fontWeight = FontWeight.Bold, + fontStyle = FontStyle.Normal, + lineHeight = 41.sp, + textAlign = TextAlign.Center + ) + + val title1 = TextStyle( + fontSize = 28.sp, + fontWeight = FontWeight.Bold, + fontStyle = FontStyle.Normal, + lineHeight = 34.sp, + textAlign = TextAlign.Center + ) + + val title2 = TextStyle( + fontSize = 22.sp, + fontWeight = FontWeight.Bold, + fontStyle = FontStyle.Normal, + lineHeight = 28.sp, + textAlign = TextAlign.Center + ) + + val title3 = TextStyle( + fontSize = 20.sp, + fontWeight = FontWeight.SemiBold, + fontStyle = FontStyle.Normal, + lineHeight = 25.sp, + textAlign = TextAlign.Center + ) + + val headline = TextStyle( + fontSize = 17.sp, + fontWeight = FontWeight.SemiBold, + fontStyle = FontStyle.Normal, + lineHeight = 22.sp, + textAlign = TextAlign.Center + ) + + val body = TextStyle( + fontSize = 17.sp, + fontWeight = FontWeight.SemiBold, + fontStyle = FontStyle.Normal, + lineHeight = 22.sp, + textAlign = TextAlign.Center + ) + + val callout = TextStyle( + fontSize = 16.sp, + fontWeight = FontWeight.SemiBold, + fontStyle = FontStyle.Normal, + lineHeight = 21.sp, + textAlign = TextAlign.Center + ) + + val subheadline = TextStyle( + fontSize = 15.sp, + fontWeight = FontWeight.SemiBold, + fontStyle = FontStyle.Normal, + lineHeight = 20.sp, + textAlign = TextAlign.Center + ) + + val footnote = TextStyle( + fontSize = 13.sp, + fontWeight = FontWeight.SemiBold, + fontStyle = FontStyle.Normal, + lineHeight = 18.sp, + textAlign = TextAlign.Center + ) + + val caption1 = TextStyle( + fontSize = 12.sp, + fontWeight = FontWeight.Medium, + fontStyle = FontStyle.Normal, + lineHeight = 16.sp, + textAlign = TextAlign.Center + ) + + val caption2 = TextStyle( + fontSize = 11.sp, + fontWeight = FontWeight.Medium, + fontStyle = FontStyle.Normal, + lineHeight = 13.sp, + textAlign = TextAlign.Center + ) + } + + object Regular { + val largeTitle = TextStyle( + fontSize = 34.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 41.sp, + textAlign = TextAlign.Center + ) + + val title1 = TextStyle( + fontSize = 28.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 34.sp, + textAlign = TextAlign.Center + ) + + val title2 = TextStyle( + fontSize = 22.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 28.sp, + textAlign = TextAlign.Center + ) + + val title3 = TextStyle( + fontSize = 20.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 25.sp, + textAlign = TextAlign.Center + ) + + val headline = TextStyle( + fontSize = 17.sp, + fontWeight = FontWeight.SemiBold, + fontStyle = FontStyle.Normal, + lineHeight = 22.sp, + textAlign = TextAlign.Center + ) + + val body = TextStyle( + fontSize = 17.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 22.sp, + textAlign = TextAlign.Center + ) + + val callout = TextStyle( + fontSize = 16.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 21.sp, + textAlign = TextAlign.Center + ) + + val subheadline = TextStyle( + fontSize = 15.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 20.sp, + textAlign = TextAlign.Center + ) + + val footnote = TextStyle( + fontSize = 13.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 18.sp, + textAlign = TextAlign.Center + ) + + val caption1 = TextStyle( + fontSize = 12.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 16.sp, + textAlign = TextAlign.Center + ) + + val caption2 = TextStyle( + fontSize = 11.sp, + fontWeight = FontWeight.Normal, + fontStyle = FontStyle.Normal, + lineHeight = 13.sp, + textAlign = TextAlign.Center + ) + } + + +} \ No newline at end of file