Refining some of the Markdown to match Material3 Style
This commit is contained in:
@@ -637,7 +637,7 @@ private fun RenderLongFormHeaderForThread(noteEvent: LongTextNoteEvent) {
|
|||||||
Text(
|
Text(
|
||||||
text = it,
|
text = it,
|
||||||
fontSize = 28.sp,
|
fontSize = 28.sp,
|
||||||
fontWeight = FontWeight.Light,
|
fontWeight = FontWeight.Bold,
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import androidx.compose.ui.text.SpanStyle
|
|||||||
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.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
import com.halilibo.richtext.ui.RichTextStyle
|
import com.halilibo.richtext.ui.RichTextStyle
|
||||||
import com.halilibo.richtext.ui.resolveDefaults
|
import com.halilibo.richtext.ui.resolveDefaults
|
||||||
@@ -177,6 +178,9 @@ val RichTextDefaults = RichTextStyle().resolveDefaults()
|
|||||||
val MarkDownStyleOnDark = RichTextDefaults.copy(
|
val MarkDownStyleOnDark = RichTextDefaults.copy(
|
||||||
paragraphSpacing = DefaultParagraphSpacing,
|
paragraphSpacing = DefaultParagraphSpacing,
|
||||||
headingStyle = DefaultHeadingStyle,
|
headingStyle = DefaultHeadingStyle,
|
||||||
|
listStyle = RichTextDefaults.listStyle?.copy(
|
||||||
|
itemSpacing = 10.sp
|
||||||
|
),
|
||||||
codeBlockStyle = RichTextDefaults.codeBlockStyle?.copy(
|
codeBlockStyle = RichTextDefaults.codeBlockStyle?.copy(
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
fontFamily = FontFamily.Monospace,
|
fontFamily = FontFamily.Monospace,
|
||||||
@@ -208,6 +212,9 @@ val MarkDownStyleOnDark = RichTextDefaults.copy(
|
|||||||
val MarkDownStyleOnLight = RichTextDefaults.copy(
|
val MarkDownStyleOnLight = RichTextDefaults.copy(
|
||||||
paragraphSpacing = DefaultParagraphSpacing,
|
paragraphSpacing = DefaultParagraphSpacing,
|
||||||
headingStyle = DefaultHeadingStyle,
|
headingStyle = DefaultHeadingStyle,
|
||||||
|
listStyle = RichTextDefaults.listStyle?.copy(
|
||||||
|
itemSpacing = 10.sp
|
||||||
|
),
|
||||||
codeBlockStyle = RichTextDefaults.codeBlockStyle?.copy(
|
codeBlockStyle = RichTextDefaults.codeBlockStyle?.copy(
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
fontFamily = FontFamily.Monospace,
|
fontFamily = FontFamily.Monospace,
|
||||||
|
|||||||
@@ -36,33 +36,32 @@ val Font17SP = 17.sp
|
|||||||
|
|
||||||
val MarkdownTextStyle = TextStyle(lineHeight = 1.30.em)
|
val MarkdownTextStyle = TextStyle(lineHeight = 1.30.em)
|
||||||
|
|
||||||
val DefaultParagraphSpacing: TextUnit = 12.sp
|
val DefaultParagraphSpacing: TextUnit = 16.sp
|
||||||
|
|
||||||
internal val DefaultHeadingStyle: HeadingStyle = { level, textStyle ->
|
internal val DefaultHeadingStyle: HeadingStyle = { level, textStyle ->
|
||||||
when (level) {
|
when (level) {
|
||||||
0 -> textStyle.copy(
|
0 -> Typography.displayLarge.copy(
|
||||||
fontSize = 30.sp,
|
fontSize = 32.sp,
|
||||||
fontWeight = FontWeight.Light
|
lineHeight = 40.sp
|
||||||
)
|
)
|
||||||
1 -> textStyle.copy(
|
1 -> Typography.displayMedium.copy(
|
||||||
fontSize = 26.sp,
|
fontSize = 28.sp,
|
||||||
fontWeight = FontWeight.Light
|
lineHeight = 36.sp
|
||||||
)
|
)
|
||||||
2 -> textStyle.copy(
|
2 -> Typography.displaySmall.copy(
|
||||||
|
fontSize = 24.sp,
|
||||||
|
lineHeight = 32.sp
|
||||||
|
)
|
||||||
|
3 -> Typography.headlineLarge.copy(
|
||||||
fontSize = 22.sp,
|
fontSize = 22.sp,
|
||||||
fontWeight = FontWeight.Light
|
lineHeight = 26.sp
|
||||||
)
|
)
|
||||||
3 -> textStyle.copy(
|
4 -> Typography.headlineMedium.copy(
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
fontWeight = FontWeight.Bold
|
lineHeight = 24.sp
|
||||||
)
|
|
||||||
4 -> textStyle.copy(
|
|
||||||
fontSize = 18.sp,
|
|
||||||
fontWeight = FontWeight.Bold
|
|
||||||
)
|
|
||||||
5 -> textStyle.copy(
|
|
||||||
fontWeight = FontWeight.Bold
|
|
||||||
)
|
)
|
||||||
|
5 -> Typography.headlineSmall
|
||||||
|
6 -> Typography.titleLarge
|
||||||
else -> textStyle
|
else -> textStyle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user