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

allow nested lists by default #30

Open
CosmicToast opened this issue Jul 30, 2023 · 1 comment
Open

allow nested lists by default #30

CosmicToast opened this issue Jul 30, 2023 · 1 comment
Labels
enhancement New feature or request visual A visual issue, affecting the appearance of pages. Can be usability-related or simply aesthetic.

Comments

@CosmicToast
Copy link

It's common to author content in markdown, and then programmatically generate html from it.
Markdown compilers typically do not include ways to add custom classes to their output.
Consequently, missing.css is relatively unusable with markdown generators when the content includes nested lists, since there's no easy way to add the class.
The potential content-side solutions include:

  • using javascript to inject the class; this does not seem like an appropriate use for js
  • parsing the output html and modifying it in-line; this is extremely complex for a script that otherwise just shells out to cmark (for example)
  • overriding the missing.css css in a second file

Since one of the goals of missing.css is to "build common components using plain, semantic HTML", and generated markdown is about as plain and semantic as it gets, this seems to be a good fit.
Of additional note, it's also a notable downgrade from classless css libraries, since those typically handle this use-case fine.

Potential solutions include:

  • having the nested-list behavior be the default
  • have an override that handles something like ul:has(li ul)
@dz4k
Copy link
Collaborator

dz4k commented Jan 27, 2024

In markdown, you can use a loose list by adding empty lines between list items:

  • a

  • b

    • c

    • d

  • e

as opposed to a tight list which doesn't have them:

  • a
  • b
    • c
    • d
  • e

This will create even spacing between all list items.

The problem we were having with removing margin automatically is that sometimes you want the margin:

  • Hello! I am a long list item containing some content. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    • I am a nested list. I shouldn't hug the paragraph above or the one below.
    I am the continuation in the list item.

This rarely occurs in Markdown since it will wrap the content in paragraphs, but it does occur in handwritten HTML.

@dz4k dz4k added enhancement New feature or request visual A visual issue, affecting the appearance of pages. Can be usability-related or simply aesthetic. labels Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request visual A visual issue, affecting the appearance of pages. Can be usability-related or simply aesthetic.
Projects
None yet
Development

No branches or pull requests

2 participants