-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
295 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 150 additions & 0 deletions
150
core/designsystem/src/main/kotlin/app/cleanmeter/core/designsystem/Typography.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
package app.cleanmeter.core.designsystem | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.text.font.FontFamily | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.platform.Font | ||
import androidx.compose.ui.unit.sp | ||
|
||
class Typography { | ||
|
||
/** | ||
* fontSize = 16.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.Medium, | ||
*/ | ||
val titleM: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 16.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.Medium, | ||
) | ||
|
||
/** | ||
* fontSize = 16.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.Medium, | ||
*/ | ||
val titleMMedium: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 16.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.Medium, | ||
) | ||
|
||
/** | ||
* fontSize = 14.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.Normal, | ||
*/ | ||
val labelL: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 14.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.Normal, | ||
) | ||
|
||
/** | ||
* fontSize = 14.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.Thin, | ||
*/ | ||
val labelLThin: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 14.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.Thin, | ||
) | ||
|
||
/** | ||
* fontSize = 14.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.Medium, | ||
*/ | ||
val labelLMedium: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 14.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.Medium, | ||
) | ||
|
||
/** | ||
* fontSize = 14.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.SemiBold, | ||
*/ | ||
val labelLSemiBold: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 14.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.SemiBold, | ||
) | ||
|
||
/** | ||
* fontSize = 13.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.Normal, | ||
*/ | ||
val labelM: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 13.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.Normal, | ||
) | ||
|
||
/** | ||
* fontSize = 13.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.SemiBold, | ||
*/ | ||
val labelMSemiBold: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 13.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.SemiBold, | ||
) | ||
|
||
/** | ||
* fontSize = 12.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.Normal, | ||
*/ | ||
val labelS: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 12.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.Normal, | ||
) | ||
|
||
/** | ||
* fontSize = 10.sp, | ||
* lineHeight = 0.sp, | ||
* fontWeight = FontWeight.Normal, | ||
*/ | ||
val bodyM: TextStyle | ||
@Composable get() = defaultTextStyle.copy( | ||
fontSize = 10.sp, | ||
lineHeight = 0.sp, | ||
fontWeight = FontWeight.Normal, | ||
) | ||
|
||
private val fontFamily = FontFamily( | ||
Font(resource = "font/inter_thin.ttf", weight = FontWeight.Thin), | ||
Font(resource = "font/inter_extralight.ttf", weight = FontWeight.ExtraLight), | ||
Font(resource = "font/inter_light.ttf", weight = FontWeight.Light), | ||
Font(resource = "font/inter_regular.ttf", weight = FontWeight.Normal), | ||
Font(resource = "font/inter_medium.ttf", weight = FontWeight.Medium), | ||
Font(resource = "font/inter_semibold.ttf", weight = FontWeight.SemiBold), | ||
Font(resource = "font/inter_bold.ttf", weight = FontWeight.Bold), | ||
Font(resource = "font/inter_extrabold.ttf", weight = FontWeight.ExtraBold), | ||
Font(resource = "font/inter_black.ttf", weight = FontWeight.Black), | ||
) | ||
|
||
private val defaultTextStyle: TextStyle | ||
@Composable get() = TextStyle( | ||
fontFamily = fontFamily, | ||
fontWeight = FontWeight.Normal, | ||
color = LocalColorScheme.current.text.paragraph1 | ||
) | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 8 additions & 23 deletions
31
target/desktop/src/main/kotlin/app/cleanmeter/target/desktop/ui/AppTheme.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,23 @@ | ||
package app.cleanmeter.target.desktop.ui | ||
|
||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Typography | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.CompositionLocalProvider | ||
import androidx.compose.ui.platform.LocalLayoutDirection | ||
import androidx.compose.ui.text.font.FontFamily | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.platform.Font | ||
import androidx.compose.ui.unit.LayoutDirection | ||
import app.cleanmeter.core.designsystem.LocalColorScheme | ||
import app.cleanmeter.core.designsystem.LocalTypography | ||
import app.cleanmeter.core.designsystem.Theme | ||
|
||
val fontFamily = FontFamily( | ||
Font(resource = "font/inter_thin.ttf", weight = FontWeight.Thin), | ||
Font(resource = "font/inter_extralight.ttf", weight = FontWeight.ExtraLight), | ||
Font(resource = "font/inter_light.ttf", weight = FontWeight.Light), | ||
Font(resource = "font/inter_regular.ttf", weight = FontWeight.Normal), | ||
Font(resource = "font/inter_medium.ttf", weight = FontWeight.Medium), | ||
Font(resource = "font/inter_semibold.ttf", weight = FontWeight.SemiBold), | ||
Font(resource = "font/inter_bold.ttf", weight = FontWeight.Bold), | ||
Font(resource = "font/inter_extrabold.ttf", weight = FontWeight.ExtraBold), | ||
Font(resource = "font/inter_black.ttf", weight = FontWeight.Black), | ||
) | ||
|
||
@Composable | ||
fun AppTheme(isDarkTheme: Boolean, content: @Composable () -> Unit) { | ||
MaterialTheme( | ||
typography = Typography(defaultFontFamily = fontFamily), | ||
) { | ||
CompositionLocalProvider(LocalColorScheme provides if (isDarkTheme) Theme.Dark else Theme.Light) { | ||
CompositionLocalProvider(LocalLayoutDirection provides LayoutDirection.Ltr) { | ||
content() | ||
} | ||
MaterialTheme { | ||
CompositionLocalProvider( | ||
LocalColorScheme provides if (isDarkTheme) Theme.Dark else Theme.Light, | ||
LocalTypography provides Theme.Typography, | ||
LocalLayoutDirection provides LayoutDirection.Ltr | ||
) { | ||
content() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
target/desktop/src/main/kotlin/app/cleanmeter/target/desktop/ui/components/Label.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.