Replies: 2 comments 3 replies
-
Hi @ylin, Currently, the list markers have a minimum width of 1.5em (that is 1.5 * current font size): You can create custom list markers with a different minimum width (i.e. 1em) to achieve the desired effect. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@gonzalezreal Hi, Can you tell me how to adjust this setting in markdownBlockStyle? I seem to have not found the correct method. import SwiftUI
import MarkdownUI
struct MarkdownView: View {
let note: Note
let containerHeight: CGFloat = 180
var body: some View {
Markdown(note.content)
.markdownTheme(.docC)
.markdownTextStyle {
FontSize(10)
}
.markdownBlockStyle(\.listItem) { configuration in
configuration.label.relativeFrame(minWidth: .em(0.5), alignment: .trailing) // ✖ not work
}
.frame(maxHeight: containerHeight, alignment: .top)
// .clipped()
.mask {
LinearGradient(
colors: [.black, .clear],
startPoint: UnitPoint(x: 0.5, y: 1 - 10 / containerHeight), endPoint: .bottom
)
}
}
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I find the left indent of lists to be too wide. Here is what it looks like now:
I would like it to look like this:
If you can point me to the code, perhaps I can create a PR for it. Best if it's already built in though, but for .markdownMargin(), I only see the top and bottom options, not leading.
Beta Was this translation helpful? Give feedback.
All reactions