Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we need this?
Uh oh!
There was an error while loading. Please reload this page.
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.
text-decoration: underlineisn't necessarily required, but most browsers have it in their default user agent stylesheets. This is an example of Chrome:So, I've added it to prevent our confusion, e.g., "Why is
text-underline-offsetspecified, regardlesstext-decorationis not?"If we want to respect browsers that don't have
text-decoration: underlineby default, we can remove it (text-underline-offsetis just ignored). 👌🏼 In this case, it might be helpful to add a code comment that describes the reason for not havingtext-decoration.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.
I have a question. We're adding this underline offset to all links, but not every link is a method name.
Will this look okay for other links that aren't method names? Should we use a more specific selector to match just method names or is the visual consistency better?
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.
I think underline offset is fine for every links.
Link text could be an URL or a filename that contains underscore. Appearance of these links also gets better.
Another example, GitHub's "Convert to draft" link and URL in pull request description text also has
text-underline-offset: .2rem; // about 3.2px.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.
Thanks for the feedback. For your information, it's easy to restrict only links that have
<code>, but it might be harder for other links, e.g.Uh oh!
There was an error while loading. Please reload this page.
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.
As GitHub does, we can also use the
remunit instead ofpx.remhas a relative value from the root font size, so it might be better to maintain.Considering the favors on #1349 (comment), I'll adjust the value if no other concerns:
reminstead ofpx2pxto keep more space.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.
I've increased the
text-underline-offsetvalue from2pxto0.2emvia f730435. See the following screenshots to see the new value:Indeed,
0.2emis interpreted as3.2pxsince the<main>and<nav>havefont-size: 16px(16px * 0.2 == 3.2px):rdoc/lib/rdoc/generator/template/darkfish/css/rdoc.css
Lines 292 to 298 in 8d07737
rdoc/lib/rdoc/generator/template/darkfish/css/rdoc.css
Lines 151 to 153 in 8d07737
The reason that I chose the
emunit instead ofremis because the Darkfish CSS doesn't specifyfont-sizeto:rootorhtmlelements (rem stands for "root em"). If this CSS hasfont-sizefor:rootin the future, we may need to reconsider theemvalue at the same time.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.
@tompng @vinistock I've pushed the commit f730435. What do you think?
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.
Looks good!