Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import io.element.android.compound.annotations.CoreColorToken
import io.element.android.compound.tokens.compoundTypography
import io.element.android.compound.tokens.generated.SemanticColors
import io.element.android.compound.tokens.generated.TypographyTokens
import io.element.android.compound.tokens.generated.compoundColorsDark
import io.element.android.compound.tokens.generated.compoundColorsLight
import io.element.android.compound.tokens.generated.internal.DarkColorTokens

/**
* Inspired from https://medium.com/@lucasyujideveloper/54cbcbde1ace
Expand Down Expand Up @@ -89,6 +91,7 @@ internal val LocalCompoundColors = staticCompositionLocalOf { compoundColorsLigh
* @param typography the Material 3 [Typography] tokens to use. It'll use [compoundTypography] by default.
* @param content the content to apply the theme to.
*/
@OptIn(CoreColorToken::class)
@Composable
fun ElementTheme(
theme: Theme = if (isSystemInDarkTheme()) Theme.Dark else Theme.Light,
Expand All @@ -106,7 +109,11 @@ fun ElementTheme(
val darkTheme = theme.isDark()
val currentCompoundColor = when {
darkTheme -> if (theme == Theme.Black) {
compoundDark.copy(bgCanvasDefault = Color.Black)
compoundDark.copy(
bgCanvasDefault = Color.Black,
// Pending design confirmation from americanrefugee/bmarty.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this comment, so that we can merge the PR. Better to discuss decision in GH issues or PR than in the code.

Also please fix the other points (CLA and screenshots).

separatorSecondary = DarkColorTokens.colorGray400,
)
} else {
compoundDark
}
Expand Down
Loading