Skip to content

Commit ed1fea8

Browse files
authored
Rollup merge of #93231 - conradludgate:doc-link-brightness, r=notriddle
adjust sidebar link brightness Fairly simple change. I've taken the existing link colour and main body background colours, and made sure that the sidebar+link contrast is the same. ayu: - [main content contrast](https://colourcontrast.cc/0f1419/39afd7) - 7.31 - [current sidebar contrast](https://colourcontrast.cc/14191f/39afd7) - 6.97 - [new sidebar contrast](https://colourcontrast.cc/14191f/56b1d9) - 7.30 dark: - [main content contrast](https://colourcontrast.cc/353535/d2991d) - 4.86 - [current sidebar contrast](https://colourcontrast.cc/14191f/d2991d) - 3.19 - [new sidebar contrast](https://colourcontrast.cc/14191f/fdbf35) - 4.87 light: - [main content contrast](https://colourcontrast.cc/ffffff/3873ad) - 4.97 - [current sidebar contrast](https://colourcontrast.cc/f5f5f5/3873ad) - 4.56 - [new sidebar contrast](https://colourcontrast.cc/f5f5f5/356da4) - 4.97
2 parents 26f14bb + ca3d0e2 commit ed1fea8

File tree

5 files changed

+70
-3
lines changed

5 files changed

+70
-3
lines changed

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

+23
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ pre, .rustdoc.source .example-wrap {
191191
color: #a37acc;
192192
}
193193

194+
.sidebar a { color: #53b1db; }
195+
.sidebar a.current.type { color: #53b1db; }
196+
.sidebar a.current.associatedtype { color: #53b1db; }
197+
194198
pre.rust .comment { color: #788797; }
195199
pre.rust .doccomment { color: #a1ac88; }
196200

@@ -485,6 +489,25 @@ a.result-static:focus {}
485489
a.result-primitive:focus {}
486490
a.result-keyword:focus {}
487491

492+
.sidebar a.current.enum {}
493+
.sidebar a.current.struct {}
494+
.sidebar a.current.foreigntype {}
495+
.sidebar a.current.attr,
496+
.sidebar a.current.derive,
497+
.sidebar a.current.macro {}
498+
.sidebar a.current.union {}
499+
.sidebar a.current.constant
500+
.sidebar a.current.static {}
501+
.sidebar a.current.primitive {}
502+
.sidebar a.current.externcrate
503+
.sidebar a.current.mod {}
504+
.sidebar a.current.trait {}
505+
.sidebar a.current.traitalias {}
506+
.sidebar a.current.fn,
507+
.sidebar a.current.method,
508+
.sidebar a.current.tymethod {}
509+
.sidebar a.current.keyword {}
510+
488511
@media (max-width: 700px) {
489512
.sidebar-menu {
490513
background-color: #14191f;

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

+22
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,28 @@ a.result-keyword:focus { background-color: #884719; }
148148
.content .fnname{ color: #2BAB63; }
149149
.content span.keyword, .content a.keyword, .block a.current.keyword { color: #D2991D; }
150150

151+
.sidebar a { color: #fdbf35; }
152+
.sidebar a.current.enum { color: #12ece2; }
153+
.sidebar a.current.struct { color: #12ece2; }
154+
.sidebar a.current.type { color: #12ece2; }
155+
.sidebar a.current.associatedtype { color: #fdbf35; }
156+
.sidebar a.current.foreigntype { color: #12ece2; }
157+
.sidebar a.current.attr,
158+
.sidebar a.current.derive,
159+
.sidebar a.current.macro { color: #0be900; }
160+
.sidebar a.current.union { color: #12ece2; }
161+
.sidebar a.current.constant
162+
.sidebar a.current.static { color: #fdbf35; }
163+
.sidebar a.current.primitive { color: #12ece2; }
164+
.sidebar a.current.externcrate
165+
.sidebar a.current.mod { color: #fdbf35; }
166+
.sidebar a.current.trait { color: #cca7ff; }
167+
.sidebar a.current.traitalias { color: #cca7ff; }
168+
.sidebar a.current.fn,
169+
.sidebar a.current.method,
170+
.sidebar a.current.tymethod { color: #32d479; }
171+
.sidebar a.current.keyword { color: #fdbf35; }
172+
151173
pre.rust .comment { color: #8d8d8b; }
152174
pre.rust .doccomment { color: #8ca375; }
153175

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

+22
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,28 @@ a.result-keyword:focus { background-color: #afc6e4; }
148148
.content .fnname { color: #AD7C37; }
149149
.content span.keyword, .content a.keyword, .block a.current.keyword { color: #3873AD; }
150150

151+
.sidebar a { color: #356da4; }
152+
.sidebar a.current.enum { color: #a63283; }
153+
.sidebar a.current.struct { color: #a63283; }
154+
.sidebar a.current.type { color: #a63283; }
155+
.sidebar a.current.associatedtype { color: #356da4; }
156+
.sidebar a.current.foreigntype { color: #356da4; }
157+
.sidebar a.current.attr,
158+
.sidebar a.current.derive,
159+
.sidebar a.current.macro { color: #067901; }
160+
.sidebar a.current.union { color: #a63283; }
161+
.sidebar a.current.constant
162+
.sidebar a.current.static { color: #356da4; }
163+
.sidebar a.current.primitive { color: #a63283; }
164+
.sidebar a.current.externcrate
165+
.sidebar a.current.mod { color: #356da4; }
166+
.sidebar a.current.trait { color: #6849c3; }
167+
.sidebar a.current.traitalias { color: #4b349e; }
168+
.sidebar a.current.fn,
169+
.sidebar a.current.method,
170+
.sidebar a.current.tymethod { color: #32d479; }
171+
.sidebar a.current.keyword { color: #356da4; }
172+
151173
nav.main .current {
152174
border-top-color: #000;
153175
border-bottom-color: #000;

src/test/rustdoc-gui/anchors.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ assert-css: (".srclink", {"text-decoration": "underline solid rgb(56, 115, 173)"
2020

2121
assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"})
2222

23-
assert-css: (".sidebar a", {"color": "rgb(56, 115, 173)"})
23+
assert-css: (".sidebar a", {"color": "rgb(53, 109, 164)"})
2424
assert-css: (".in-band a", {"color": "rgb(0, 0, 0)"})
2525

2626
// We move the cursor over the "Implementations" title so the anchor is displayed.

src/test/rustdoc-gui/sidebar.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ assert-text: (".sidebar > .location", "Crate test_docs")
99
// In modules, we only have one "location" element.
1010
assert-count: (".sidebar .location", 1)
1111
assert-text: ("#all-types", "All Items")
12-
assert-css: ("#all-types", {"color": "rgb(56, 115, 173)"})
12+
assert-css: ("#all-types", {"color": "rgb(53, 109, 164)"})
1313
// We check that we have the crates list and that the "current" on is "test_docs".
1414
assert-text: (".sidebar-elems .crate > ul > li > a.current", "test_docs")
1515
// And we're also supposed to have the list of items in the current module.
@@ -38,7 +38,7 @@ assert-property: ("html", {"scrollTop": "0"})
3838

3939
// We now go back to the crate page to click on the "lib2" crate link.
4040
goto: file://|DOC_PATH|/test_docs/index.html
41-
assert-css: (".sidebar-elems .crate > ul > li:first-child > a", {"color": "rgb(56, 115, 173)"})
41+
assert-css: (".sidebar-elems .crate > ul > li:first-child > a", {"color": "rgb(53, 109, 164)"})
4242
click: ".sidebar-elems .crate > ul > li:first-child > a"
4343

4444
// PAGE: lib2/index.html

0 commit comments

Comments
 (0)