Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom spacing before and after bulleted list #334

Open
AlexNsbmr opened this issue Jul 3, 2024 · 2 comments
Open

Custom spacing before and after bulleted list #334

AlexNsbmr opened this issue Jul 3, 2024 · 2 comments

Comments

@AlexNsbmr
Copy link

AlexNsbmr commented Jul 3, 2024

First of all, thank you for this amazing library!

Currently, it is not possible to set custom spacing specifically before and after bulleted list blocks in MarkdownUI. This feature would greatly enhance the ability to control the layout and presentation of lists within the library.

Screenshot 2024-07-03 at 09 36 12

At present, any changes to spacing affect the overall block styles, making it impossible to target only bulleted lists.

Are there any plans to add support for setting custom spacing before and after bulleted list blocks in future updates?

@gonzalezreal
Copy link
Owner

Hi @AlexNsbmr,

You can control top and bottom margins for lists by overriding the current theme's list block style.

Markdown {
  """
  A list:

  * Item 1
  * Item 2
  * Item 3

  Paragraph after the list.
  """
}
.markdownBlockStyle(\.list) { label in
  label.markdownMargin(top: .zero, bottom: .em(0.8))
}

This change applies to all list types: bulleted, numerical and task lists. At the moment there are no plans to allow overriding the style for a single type of list. What is the reasoning behind having different margins depending on the list type?

@ArchimedesTrajano
Copy link

ArchimedesTrajano commented Oct 14, 2024

It only accepts the top and bottom margins, so how about the leading margin before the bullets?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants