-
Notifications
You must be signed in to change notification settings - Fork 440
Polish link underline in Darkfish CSS #1349
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
Open
ybiquitous
wants to merge
2
commits into
ruby:master
Choose a base branch
from
ybiquitous:css-link-underline
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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?
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: underline
isn'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-offset
specified, regardlesstext-decoration
is not?"If we want to respect browsers that don't have
text-decoration: underline
by default, we can remove it (text-underline-offset
is 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.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
rem
unit instead ofpx
.rem
has 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:
rem
instead ofpx
2px
to 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-offset
value from2px
to0.2em
via f730435. See the following screenshots to see the new value:Indeed,
0.2em
is interpreted as3.2px
since 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
em
unit instead ofrem
is because the Darkfish CSS doesn't specifyfont-size
to:root
orhtml
elements (rem stands for "root em"). If this CSS hasfont-size
for:root
in the future, we may need to reconsider theem
value at the same time.