Use distinct styles for note lists and label lists#1209
Conversation
|
For what it's worth, here are a few times the styles for these have been updated:
Anyway, this does not mean we need to style them differently by default. If we add the closing If this PR is accepted, I'm willing to create a PR for similar styling for |
|
FWIW, I've experimented with four different styles. The "label" style restored by #1208: The "note" style in this PR: Before making these PRs, I was considering a more table-like style for "notes" (e.g. as used by Another reasonable approach would be to mimic how rdoc allows the comments to be formatted, indenting each |
As a default for all description lists, the original "label" style is more readable. This is slightly different from the original `label` dl though: * slightly increased left margin for `dd` (to 1em) * removed right margin on `dd` * removed `dt` bottom margin and `dd` top margin, to reduce the gap between the term and its description (to only the standard line-height gap).
Without the closing tags, the dt elements contain whitespace after the text. This normally isn't a big deal, but does mess some things up, e.g: using `::after` with `content: ", "` in stylesheets.
Unlike the original note list styles, this version sets the line-height for all `dt` elements to be the same as the `p` elements contained inside the `dd`, so that the second line has the same indentation as all subsequent lines.
827ed7c to
4e56713
Compare
|
I just opened a similar issue at #1227 and I wanted to say that this PR solves my problem exactly as I'd hoped. ❤️ |
st0012
left a comment
There was a problem hiding this comment.
Sorry for the delay. I think the updated style looks great and thanks for fixing the tag closing issue as well 👍
(ruby/rdoc#1209) * Use the original `label` description list style As a default for all description lists, the original "label" style is more readable. This is slightly different from the original `label` dl though: * slightly increased left margin for `dd` (to 1em) * removed right margin on `dd` * removed `dt` bottom margin and `dd` top margin, to reduce the gap between the term and its description (to only the standard line-height gap). * Add closing tags for description list terms Without the closing tags, the dt elements contain whitespace after the text. This normally isn't a big deal, but does mess some things up, e.g: using `::after` with `content: ", "` in stylesheets. * Restore float:left style for note lists Unlike the original note list styles, this version sets the line-height for all `dt` elements to be the same as the `p` elements contained inside the `dd`, so that the second line has the same indentation as all subsequent lines. * Add commas between note list terms ruby/rdoc@9e69ea6d75

Together with #1208, this brings back the original "note" and "label" list styles. It also improves on the original "note" list styling in two ways: 1) the second line and every line after it share the same indentation, and 2) commas are added between multiple
dtelements.labeldescription list style #1208This also removes
margin-bottomfromdt, which is necessary for the second indentation to match subsequent lines.Necessary for adding separators between
dt.float: leftstyle, for note lists onlydtline-heightto matchmain p.Otherwise, the
dthas a largerline-heightthan theptag inside thedd, which causes the second line to have the same indentation as the first but different from the third.This fixes #1199.