Skip to content
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

Do not underline navigation links #169

Merged
merged 2 commits into from
Feb 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions python_docs_theme/static/pydoctheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,31 @@ a[href] {
text-decoration: underline 1px;
text-underline-offset: 0.25em;
}
/* No underline for navigation */
a.headerlink,
div.genindex-jumpbox a,
div.modindex-jumpbox a,
div#search-results a,
div.sphinxsidebar a,
div.toctree-wrapper a,
div[role=navigation] a,
table.contentstable a,
table.indextable a {
text-decoration: none;
}

/* Except when hovered */
div.genindex-jumpbox a:hover,
div.modindex-jumpbox a:hover,
div#search-results a:hover,
div.sphinxsidebar a:hover,
div.toctree-wrapper a:hover,
div[role=navigation] a:hover,
table.contentstable a:hover,
table.indextable a:hover {
text-decoration: underline;
text-underline-offset: auto;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto should already be the default -- is there something else overriding this when it's not explicitly stated, or did you add it as a precaution to prevent other rules from overriding the value in case the offset is added to some parent container in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there something else overriding this when it's not explicitly stated ...

Yes, it's overridden by this:

a[href] {
    text-decoration: underline 1px;
    text-underline-offset: 0.25em;
}

So "normal" body text links have underlines with extra offset; but navigational links only have underlines for hover, and they're the default offset.

}

body {
margin-left: 1em;
Expand Down Expand Up @@ -284,6 +309,10 @@ div.footer {
margin-right: 10px;
}

div.footer a {
text-underline-offset: auto;
}

div.footer a:hover {
color: #0095c4;
}
Expand Down
Loading