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

Fix font size for [src] links in headers #92404

Merged
merged 3 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1080,8 +1080,11 @@ body.blur > :not(#help) {

.impl-items .srclink, .impl .srclink, .methods .srclink {
/* Override header settings otherwise it's too bold */
font-size: 1.0625rem;
font-weight: normal;
font-size: 1rem;
}
.impl .srclink {
font-size: 1.0625rem;
}

.rightside {
Expand Down
5 changes: 1 addition & 4 deletions src/librustdoc/html/static/css/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,8 @@ a.test-arrow:hover {
color: #999;
}

:target, :target > * {
background: rgba(255, 236, 164, 0.06);
}

:target {
background: rgba(255, 236, 164, 0.06);
border-right: 3px solid rgba(255, 180, 76, 0.85);
}

Expand Down
5 changes: 1 addition & 4 deletions src/librustdoc/html/static/css/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,8 @@ a.test-arrow:hover{
color: #999;
}

:target, :target > * {
background-color: #494a3d;
}

:target {
background-color: #494a3d;
border-right: 3px solid #bb7410;
}

Expand Down
5 changes: 1 addition & 4 deletions src/librustdoc/html/static/css/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,8 @@ a.test-arrow:hover{
color: #999;
}

:target, :target > * {
background: #FDFFD3;
}

:target {
background: #FDFFD3;
border-right: 3px solid #AD7C37;
}

Expand Down
12 changes: 12 additions & 0 deletions src/test/rustdoc-gui/src-font-size.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This test ensures that the "[src]" have the same font size as their headers
// to avoid having some weird height difference in the background when the element
// is selected.
goto: file://|DOC_PATH|/test_docs/struct.Foo.html
show-text: true
// Check the impl headers.
assert-css: (".impl.has-srclink .srclink", {"font-size": "17px"}, ALL)
// The ".6" part is because the font-size is actually "1.1em".
assert-css: (".impl.has-srclink .code-header.in-band", {"font-size": "17.6px"}, ALL)
// Check the impl items.
assert-css: (".impl-items .has-srclink .srclink", {"font-size": "16px"}, ALL)
assert-css: (".impl-items .has-srclink .code-header", {"font-size": "16px"}, ALL)