-
Notifications
You must be signed in to change notification settings - Fork 440
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
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. ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. I think the updated style looks great and thanks for fixing the tag closing issue as well 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops I was meant to approve
(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
dt
elements.label
description list style #1208This also removes
margin-bottom
fromdt
, which is necessary for the second indentation to match subsequent lines.Necessary for adding separators between
dt
.float: left
style, for note lists onlydt
line-height
to matchmain p
.Otherwise, the
dt
has a largerline-height
than thep
tag inside thedd
, which causes the second line to have the same indentation as the first but different from the third.This fixes #1199.