Skip to content

HTML styles for compact lists are not compact #964

Description

@martinthomson

Describe the issue

The compact styling on definition lists (<dl spacing="compact">) does not appear to function properly.

https://www.ietf.org/archive/id/draft-ietf-ohai-ohttp-06.html#section-9.1 includes a large definition list that uses the compact spacing, however it does not render very differently from the normal one. My expectation is that the compact spacing approximates the inter-line spacing of a regular paragraph, but this appears to be half-way between that and the full spacing.

(Separately, the full spacing is extremely wide, which might have the same cause.)

My investigation shows that this is due to the content of the <dd> element including elements (<p> in this case) that have their own margins. These margins still apply, but it appears to expand the spacing between items.

I found that the following works, even if it is a little clunky:

:is(dl.compact, .dlCompact) > dd > :is(:first-child, .break:first-child + *) {
  margin-top: 0;
}
:is(dl.compact, .dlCompact) > dd > :last-child {
  margin-bottom: 0;
}

(The .break elements that are scattered throughout are a little annoying to style around; I just set them to display: none but then I need to do this hack here. The dl.compact rule is for Julian's XSLT output, but it's been a while since I checked how that renders; ignore that one.)

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghtmlIssues in HTML output and HTML writerpdfIssues in PDF output and PDF writerrpatIssues needing attention from RFC Production Advisory Team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions