Skip to content

Commit b510278

Browse files
authored
Rollup merge of rust-lang#92404 - GuillaumeGomez:src-font-size, r=jsha
Fix font size for [src] links in headers Fixes rust-lang#90384. cc `@jsha` r? `@camelid`
2 parents 96a267e + 3b70c6e commit b510278

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,8 +1080,11 @@ body.blur > :not(#help) {
10801080

10811081
.impl-items .srclink, .impl .srclink, .methods .srclink {
10821082
/* Override header settings otherwise it's too bold */
1083-
font-size: 1.0625rem;
10841083
font-weight: normal;
1084+
font-size: 1rem;
1085+
}
1086+
.impl .srclink {
1087+
font-size: 1.0625rem;
10851088
}
10861089

10871090
.rightside {

src/librustdoc/html/static/css/themes/ayu.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,8 @@ a.test-arrow:hover {
351351
color: #999;
352352
}
353353

354-
:target, :target > * {
355-
background: rgba(255, 236, 164, 0.06);
356-
}
357-
358354
:target {
355+
background: rgba(255, 236, 164, 0.06);
359356
border-right: 3px solid rgba(255, 180, 76, 0.85);
360357
}
361358

src/librustdoc/html/static/css/themes/dark.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,8 @@ a.test-arrow:hover{
295295
color: #999;
296296
}
297297

298-
:target, :target > * {
299-
background-color: #494a3d;
300-
}
301-
302298
:target {
299+
background-color: #494a3d;
303300
border-right: 3px solid #bb7410;
304301
}
305302

src/librustdoc/html/static/css/themes/light.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,8 @@ a.test-arrow:hover{
284284
color: #999;
285285
}
286286

287-
:target, :target > * {
288-
background: #FDFFD3;
289-
}
290-
291287
:target {
288+
background: #FDFFD3;
292289
border-right: 3px solid #AD7C37;
293290
}
294291

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

0 commit comments

Comments
 (0)