X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustdoc%2Fhtml%2Fstatic%2Fcss%2Frustdoc.css;h=14f27eb6fa8a49c1b009368da14cc5e84bc4d54f;hb=11a52dc61afda5ea82cff3e783e24f2302bdce3f;hp=22217a390124647e577231428547c00d5f36d487;hpb=fcdd5016c518c3ac3e46183933c65dc23c9f5f51;p=rust.git diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 22217a39012..14f27eb6fa8 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -206,7 +206,6 @@ a.source, .item-left > a, .out-of-band, span.since, -#source-sidebar, #sidebar-toggle, details.rustdoc-toggle > summary::before, .content ul.crate a.crate, a.srclink, @@ -347,10 +346,6 @@ img { max-width: 100%; } -li { - position: relative; -} - .source .content { max-width: none; overflow: visible; @@ -596,10 +591,6 @@ h2.location a { margin: 0; } -#search { - position: relative; -} - .search-loading { text-align: center; } @@ -618,16 +609,12 @@ h2.location a { .docblock-short { overflow-wrap: break-word; overflow-wrap: anywhere; -} -.docblock-short p { - display: inline; overflow: hidden; text-overflow: ellipsis; - margin: 0; } /* Wrap non-pre code blocks (`text`) but not (```text```). */ .docblock > :not(pre) > code, -.docblock-short > :not(pre) > code { +.docblock-short > code { white-space: pre-wrap; } @@ -652,7 +639,7 @@ h2.location a { position: relative; } -.docblock > :not(.information):not(.more-examples-toggle) { +.docblock > :not(.more-examples-toggle):not(.example-wrap) { max-width: 100%; overflow-x: auto; } @@ -977,7 +964,6 @@ so that we can apply CSS-filters to change the arrow color in themes */ .search-results > a { display: block; - width: 100%; /* A little margin ensures the browser's outlining of focused links has room to display. */ margin-left: 2px; margin-right: 2px; @@ -1160,42 +1146,100 @@ pre.rust .question-mark { font-weight: bold; } -pre.compile_fail, -pre.should_panic { +.example-wrap.compile_fail, +.example-wrap.should_panic { border-left: 2px solid var(--codeblock-error-color); } -pre.ignore { +.ignore.example-wrap { border-left: 2px solid var(--codeblock-ignore-color); } -pre.compile_fail:hover, .information:hover + .example-wrap pre.compile_fail, -pre.should_panic:hover, .information:hover + .example-wrap pre.should_panic { +.example-wrap.compile_fail:hover, +.example-wrap.should_panic:hover { border-left: 2px solid var(--codeblock-error-hover-color); } -pre.ignore:hover, .information:hover + .example-wrap pre.ignore { +.example-wrap.ignore:hover { border-left: 2px solid var(--codeblock-ignore-hover-color); } -.tooltip.compile_fail, -.tooltip.should_panic { +.example-wrap.compile_fail .tooltip, +.example-wrap.should_panic .tooltip { color: var(--codeblock-error-color); } -.tooltip.ignore { +.example-wrap.ignore .tooltip { color: var(--codeblock-ignore-color); } -.information > .compile_fail:hover, -.information > .should_panic:hover { +.example-wrap.compile_fail:hover .tooltip, +.example-wrap.should_panic:hover .tooltip { color: var(--codeblock-error-hover-color); } -.information > .ignore:hover { +.example-wrap.ignore:hover .tooltip { color: var(--codeblock-ignore-hover-color); } +.example-wrap .tooltip { + position: absolute; + display: block; + cursor: pointer; + left: -25px; + top: 5px; +} + +.example-wrap .tooltip::after { + display: none; + text-align: center; + padding: 5px 3px 3px 3px; + border-radius: 6px; + margin-left: 5px; + font-size: 1rem; + border: 1px solid var(--border-color); + position: absolute; + width: max-content; + top: -2px; + z-index: 1; +} + +.example-wrap .tooltip::before { + content: " "; + position: absolute; + top: 50%; + left: 16px; + margin-top: -5px; + border-width: 5px; + border-style: solid; + display: none; + z-index: 1; +} + +.example-wrap.ignore .tooltip::after { + content: "This example is not tested"; +} +.example-wrap.compile_fail .tooltip::after { + content: "This example deliberately fails to compile"; +} +.example-wrap.should_panic .tooltip::after { + content: "This example panics"; +} +.example-wrap.edition .tooltip::after { + content: "This code runs with edition " attr(data-edition); +} + +.example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after { + display: inline; +} + +.example-wrap.compile_fail .tooltip, +.example-wrap.should_panic .tooltip, +.example-wrap.ignore .tooltip { + font-weight: bold; + font-size: 1.25rem; +} + a.test-arrow { display: inline-block; visibility: hidden; @@ -1261,62 +1305,6 @@ h3.variant { padding-right: 3px; } -.information { - position: absolute; - left: -25px; - margin-top: 7px; - z-index: 1; -} - -.tooltip { - position: relative; - display: inline-block; - cursor: pointer; -} - -.tooltip::after { - display: none; - text-align: center; - padding: 5px 3px 3px 3px; - border-radius: 6px; - margin-left: 5px; - font-size: 1rem; - border: 1px solid var(--border-color); -} - -.tooltip.ignore::after { - content: "This example is not tested"; -} -.tooltip.compile_fail::after { - content: "This example deliberately fails to compile"; -} -.tooltip.should_panic::after { - content: "This example panics"; -} -.tooltip.edition::after { - content: "This code runs with edition " attr(data-edition); -} - -.tooltip::before { - content: " "; - position: absolute; - top: 50%; - left: 16px; - margin-top: -5px; - border-width: 5px; - border-style: solid; - display: none; -} - -.tooltip:hover::before, .tooltip:hover::after { - display: inline; -} - -.tooltip.compile_fail, .tooltip.should_panic, .tooltip.ignore { - font-weight: bold; - font-size: 1.25rem; -} - .notable-traits-tooltip { display: inline-block; cursor: pointer; @@ -1358,7 +1346,7 @@ h3.variant { display: block; } -.notable-traits .docblock code.content{ +.notable-traits .docblock code.content { margin: 0; padding: 0; font-size: 1.25rem; @@ -1727,7 +1715,7 @@ in storage.js plus the media query with (max-width: 700px) to prevent an overlay between the "collapse toggle" and the information tooltip. However, it's not needed with smaller screen width because the doc/code block is always put "one line" below. */ - .docblock > .information:first-child > .tooltip { + .docblock > .example-wrap:first-child .tooltip { margin-top: 16px; } @@ -1898,11 +1886,6 @@ in storage.js plus the media query with (min-width: 701px) margin-top: 10px; } - #search { - margin-left: 0; - padding: 0; - } - .anchor { display: none !important; }