Skip to content

Conversation

@jonathanhefner
Copy link
Member

List items inside #content use var(--space-sm) as their top margin because var(--space) looks too disjointed for single-paragraph items, especially single-line items. However, when a list item contains an element that itself has a var(--space) top margin, the list item's top margin looks mismatched.

This commit adds a style tweak such that all list items in a list with any multi-paragraph items will use var(--space) for their top margin. (More specifically, when any item contains a paragraph plus another block level element, such as another paragraph or a code block.)

Unfortunately, this enhancement does not currently work in Firefox because it relies on the :has() selector. However, it is only a minor enhancement, and Firefox plans to support :has() in the near future.

Before After
before1 after1
before2-after2 before2-after2 (same)

List items inside `#content` use `var(--space-sm)` as their top margin
because `var(--space)` looks too disjointed for single-paragraph items,
especially single-line items.  However, when a list item contains an
element that itself has a `var(--space)` top margin, the list item's top
margin looks mismatched.

This commit adds a style tweak such that all list items in a list with
any multi-paragraph items will use `var(--space)` for their top margin.
(More specifically, when any item contains a paragraph plus another
block level element, such as another paragraph or a code block.)

Unfortunately, this enhancement does not currently work in Firefox
because it relies on the `:has()` selector.  However, it is only a minor
enhancement, and Firefox plans to support `:has()` in the near future.
@jonathanhefner jonathanhefner merged commit 9cd238e into rails:main Aug 28, 2023
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

Successfully merging this pull request may close these issues.

1 participant