diff options
Diffstat (limited to 'src/librustdoc/html/static')
| -rw-r--r-- | src/librustdoc/html/static/main.js | 4 | ||||
| -rw-r--r-- | src/librustdoc/html/static/rustdoc.css | 80 | ||||
| -rw-r--r-- | src/librustdoc/html/static/themes/ayu.css | 3 | ||||
| -rw-r--r-- | src/librustdoc/html/static/themes/dark.css | 3 | ||||
| -rw-r--r-- | src/librustdoc/html/static/themes/light.css | 3 |
5 files changed, 69 insertions, 24 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 1a15a444a70..fe1ce2e8b5c 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -703,8 +703,10 @@ function hideThemeButtonState() { } } - var code = document.createElement("code"); + var code = document.createElement("h3"); code.innerHTML = struct.text; + addClass(code, "code-header"); + addClass(code, "in-band"); onEachLazy(code.getElementsByTagName("a"), function(elem) { var href = elem.getAttribute("href"); diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index d8684641a30..f801ef09c50 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -134,12 +134,25 @@ h1.fqn { h1.fqn > .in-band > a:hover { text-decoration: underline; } -h2, h3, h4 { +#main > h2, #main > h3, #main > h4 { border-bottom: 1px solid; } -.impl, .method, -.type:not(.container-rustdoc), .associatedconstant, -.associatedtype { +h3.code-header, h4.code-header { + font-size: 1em; + font-weight: 600; + border: none; + padding: 0; + margin: 0; +} +.impl, +.impl-items .method, +.methods .method, +.impl-items .type, +.methods .type, +.impl-items .associatedconstant, +.methods .associatedconstant, +.impl-items .associatedtype, +.methods .associatedtype { flex-basis: 100%; font-weight: 600; margin-top: 16px; @@ -190,7 +203,34 @@ summary { outline: none; } -code, pre, a.test-arrow { +/* Fix some style changes due to normalize.css 8 */ + +td, +th { + padding: 0; +} + +table { + border-collapse: collapse; +} + +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; +} + +/* end tweaks for normalize.css 8 */ + +details:not(.rustdoc-toggle) summary { + margin-bottom: .6em; +} + +code, pre, a.test-arrow, .code-header { font-family: "Source Code Pro", monospace; } .docblock code, .docblock-short code { @@ -296,6 +336,8 @@ nav.sub { margin: 30px 10px 20px 10px; text-align: center; word-wrap: break-word; + font-weight: inherit; + padding: 0; } .sidebar .version { @@ -348,6 +390,8 @@ nav.sub { text-align: center; font-size: 17px; margin-bottom: 5px; + font-weight: inherit; + padding: 0; } .sidebar-links { @@ -470,9 +514,10 @@ nav.sub { font-weight: normal; } -.method > code, .trait-impl > code, .invisible > code { +.method > .code-header, .trait-impl > .code-header, .invisible > .code-header { max-width: calc(100% - 41px); display: block; + flex-grow: 1; } .invisible { @@ -486,7 +531,7 @@ nav.sub { padding: 0px; } -.in-band > code { +.in-band > code, .in-band > .code-header { display: inline-block; } @@ -581,7 +626,7 @@ nav.sub { .content .item-info { position: relative; margin-left: 33px; - margin-top: -13px; + margin-top: -6px; } .sub-variant > div > .item-info { @@ -592,7 +637,7 @@ nav.sub { content: '⬑'; font-size: 25px; position: absolute; - top: -6px; + top: 0px; left: -19px; } @@ -686,7 +731,7 @@ a { } .invisible > .srclink, -.method > code + .srclink { +.method > .code-header + .srclink { position: absolute; top: 0; right: 0; @@ -908,7 +953,7 @@ body.blur > :not(#help) { .impl-items .since, .impl .since, .methods .since { flex-grow: 0; padding-left: 12px; - padding-right: 2px; + padding-right: 6px; position: initial; } @@ -1041,8 +1086,7 @@ a.test-arrow:hover{ display: block; } - -:target > code { +:target > code, :target > .code-header { opacity: 1; } @@ -1577,15 +1621,18 @@ details.undocumented[open] > summary::before { display: none; } + /* We do NOT hide this element so that alternative device readers still have this information + available. */ .sidebar-elems { position: fixed; z-index: 1; - left: 0; top: 45px; bottom: 0; + width: 246px; + /* We move the sidebar to the left by its own width so it doesn't appear. */ + left: -246px; overflow-y: auto; border-right: 1px solid; - display: none; } .sidebar > .block.version { @@ -1662,8 +1709,7 @@ details.undocumented[open] > summary::before { } .show-it { - display: block; - width: 246px; + left: 0; } .show-it > .block.items { diff --git a/src/librustdoc/html/static/themes/ayu.css b/src/librustdoc/html/static/themes/ayu.css index d220d8708a1..1fc648d76b9 100644 --- a/src/librustdoc/html/static/themes/ayu.css +++ b/src/librustdoc/html/static/themes/ayu.css @@ -133,7 +133,6 @@ pre, .rustdoc.source .example-wrap { color: #708090; background-color: rgba(255, 236, 164, 0.06); padding-right: 4px; - border-right: 1px solid #ffb44c; } .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { @@ -334,7 +333,7 @@ a.test-arrow:hover { color: #999; } -:target > code, :target > .in-band { +:target, :target > * { background: rgba(255, 236, 164, 0.06); border-right: 3px solid rgba(255, 180, 76, 0.85); } diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/themes/dark.css index 6385a763f2e..3105a99de1e 100644 --- a/src/librustdoc/html/static/themes/dark.css +++ b/src/librustdoc/html/static/themes/dark.css @@ -282,9 +282,8 @@ a.test-arrow:hover{ color: #999; } -:target > code, :target > .in-band { +:target, :target > * { background-color: #494a3d; - border-right: 3px solid #bb7410; } pre.compile_fail { diff --git a/src/librustdoc/html/static/themes/light.css b/src/librustdoc/html/static/themes/light.css index c19d5bfc317..10fde92dcb8 100644 --- a/src/librustdoc/html/static/themes/light.css +++ b/src/librustdoc/html/static/themes/light.css @@ -275,9 +275,8 @@ a.test-arrow:hover{ color: #999; } -:target > code, :target > .in-band { +:target, :target > * { background: #FDFFD3; - border-right: 3px solid #ffb44c; } pre.compile_fail { |
