Browse Source

Try to map some theming colors/font but it makes no sense at the moment

feature/bma/flipper
ganfra 2 years ago
parent
commit
50efcc1bfb
  1. 25
      libraries/designsystem/src/main/java/io/element/android/x/designsystem/Color.kt
  2. 4
      libraries/designsystem/src/main/java/io/element/android/x/designsystem/Theme.kt
  3. 192
      libraries/designsystem/src/main/java/io/element/android/x/designsystem/Type.kt

25
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 AvatarGradientStart = Color(0xFF4CA1AF)
val AvatarGradientEnd = Color(0xFFC4E0E5) val AvatarGradientEnd = Color(0xFFC4E0E5)
val SystemGreyLight = Color(0xFFE5E5EA) val SystemGreyLight = Color(0xFF8E8E93)
val SystemGreyDark = Color(0xFF1C1C1E) 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)

4
libraries/designsystem/src/main/java/io/element/android/x/designsystem/Theme.kt

@ -16,7 +16,7 @@ private val DarkColorScheme = darkColorScheme(
background = Color.Black, background = Color.Black,
onBackground = Color.White, onBackground = Color.White,
surface = Color.Black, surface = Color.Black,
surfaceVariant = SystemGreyDark, surfaceVariant = SystemGrey6Dark,
onSurface = Color.White, onSurface = Color.White,
onSurfaceVariant = Color.White, onSurfaceVariant = Color.White,
) )
@ -28,7 +28,7 @@ private val LightColorScheme = lightColorScheme(
background = Color.White, background = Color.White,
onBackground = Color.Black, onBackground = Color.Black,
surface = Color.White, surface = Color.White,
surfaceVariant = SystemGreyLight, surfaceVariant = SystemGrey6Light,
onSurface = Color.Black, onSurface = Color.Black,
onSurfaceVariant = Color.Black, onSurfaceVariant = Color.Black,

192
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.material3.Typography
import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontFamily 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.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
// Set of Material typography styles to start with // Set of Material typography styles to start with
@ -22,8 +24,7 @@ val Typography = Typography(
fontSize = 32.sp, fontSize = 32.sp,
lineHeight = 24.sp, lineHeight = 24.sp,
letterSpacing = 0.5.sp letterSpacing = 0.5.sp
) ),
/* Other default text styles to override /* Other default text styles to override
titleLarge = TextStyle( titleLarge = TextStyle(
fontFamily = FontFamily.Default, fontFamily = FontFamily.Default,
@ -40,4 +41,189 @@ val Typography = Typography(
letterSpacing = 0.5.sp letterSpacing = 0.5.sp
) )
*/ */
) )
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
)
}
}
Loading…
Cancel
Save