Skip to content

Commit

Permalink
Rollup merge of #92404 - GuillaumeGomez:src-font-size, r=jsha
Browse files Browse the repository at this point in the history
Fix font size for [src] links in headers

Fixes #90384.

cc `@jsha`
r? `@camelid`
  • Loading branch information
matthiaskrgr authored Jan 6, 2022
2 parents 96a267e + 3b70c6e commit b510278
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
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)

0 comments on commit b510278

Please sign in to comment.