]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/html/static/css/rustdoc.css
Rollup merge of #101494 - jsha:notable-traits-right, r=GuillaumeGomez
[rust.git] / src / librustdoc / html / static / css / rustdoc.css
index 3502d97d470fecb56c39d3012db24cfb62ea1bb2..0e48b1009d8aacc0e3a714ec9c416bcbb3f7c58b 100644 (file)
@@ -197,10 +197,6 @@ h4.code-header {
        position: relative;
 }
 
-div.impl-items > div {
-       padding-left: 0;
-}
-
 h1, h2, h3, h4, h5, h6,
 .sidebar,
 .mobile-topbar,
@@ -210,9 +206,7 @@ a.source,
 .item-left > a,
 .out-of-band,
 span.since,
-#source-sidebar, #sidebar-toggle,
 details.rustdoc-toggle > summary::before,
-div.impl-items > div:not(.docblock):not(.item-info),
 .content ul.crate a.crate,
 a.srclink,
 #help-button > button,
@@ -228,7 +222,6 @@ details.rustdoc-toggle.non-exhaustive > summary::before,
        font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
 }
 
-h1, h2, h3, h4,
 a#toggle-all-docs,
 a.anchor,
 .small-section-header a,
@@ -352,10 +345,6 @@ img {
        max-width: 100%;
 }
 
-li {
-       position: relative;
-}
-
 .source .content {
        max-width: none;
        overflow: visible;
@@ -601,19 +590,10 @@ h2.location a {
        margin: 0;
 }
 
-#search {
-       position: relative;
-}
-
 .search-loading {
        text-align: center;
 }
 
-#results > table {
-       width: 100%;
-       table-layout: fixed;
-}
-
 .content > .example-wrap pre.line-numbers {
        position: relative;
        -webkit-user-select: none;
@@ -628,16 +608,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;
 }
 
@@ -662,7 +638,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;
 }
@@ -704,18 +680,6 @@ pre, .rustdoc.source .example-wrap {
 #main-content {
        position: relative;
 }
-#main-content > .since {
-       top: inherit;
-}
-
-.content table {
-       border-spacing: 0 5px;
-}
-.content td { vertical-align: top; }
-.content td:first-child { padding-right: 20px; }
-.content td p:first-child { margin-top: 0; }
-.content td h1, .content td h2 { margin-left: 0; font-size: 1.125rem; }
-.content tr:first-child td { border-top: 0; }
 
 .docblock table {
        margin: .5em 0;
@@ -727,6 +691,7 @@ pre, .rustdoc.source .example-wrap {
 .docblock table td {
        padding: .5em;
        border: 1px dashed var(--border-color);
+       vertical-align: top;
 }
 
 .docblock table th {
@@ -752,11 +717,6 @@ pre, .rustdoc.source .example-wrap {
        font-size: 0.875rem;
 }
 
-.content .methods > div:not(.notable-traits):not(.method) {
-       margin-left: 40px;
-       margin-bottom: 15px;
-}
-
 .item-info {
        display: block;
 }
@@ -770,10 +730,6 @@ pre, .rustdoc.source .example-wrap {
        margin-left: 24px;
 }
 
-.sub-variant > div > .item-info {
-       margin-top: initial;
-}
-
 .content .impl-items .docblock, .content .impl-items .item-info {
        margin-bottom: .6em;
 }
@@ -797,7 +753,6 @@ nav.sub form { display: inline; }
 
 a {
        text-decoration: none;
-       background: transparent;
 }
 
 .small-section-header {
@@ -999,7 +954,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;
@@ -1018,12 +972,6 @@ so that we can apply CSS-filters to change the arrow color in themes */
        padding-right: 1em;
 }
 
-.search-results .result-name > span {
-       display: inline-block;
-       margin: 0;
-       font-weight: normal;
-}
-
 .popover {
        font-size: 1rem;
        position: absolute;
@@ -1182,6 +1130,100 @@ pre.rust .question-mark {
        font-weight: bold;
 }
 
+.example-wrap.compile_fail,
+.example-wrap.should_panic {
+       border-left: 2px solid var(--codeblock-error-color);
+}
+
+.ignore.example-wrap {
+       border-left: 2px solid var(--codeblock-ignore-color);
+}
+
+.example-wrap.compile_fail:hover,
+.example-wrap.should_panic:hover {
+       border-left: 2px solid var(--codeblock-error-hover-color);
+}
+
+.example-wrap.ignore:hover {
+       border-left: 2px solid var(--codeblock-ignore-hover-color);
+}
+
+.example-wrap.compile_fail .tooltip,
+.example-wrap.should_panic .tooltip {
+       color: var(--codeblock-error-color);
+}
+
+.example-wrap.ignore .tooltip {
+       color:  var(--codeblock-ignore-color);
+}
+
+.example-wrap.compile_fail:hover .tooltip,
+.example-wrap.should_panic:hover .tooltip {
+       color: var(--codeblock-error-hover-color);
+}
+
+.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;
@@ -1211,7 +1253,6 @@ a.test-arrow:hover {
 }
 
 .out-of-band > span.since {
-       position: initial;
        font-size: 1.25rem;
 }
 
@@ -1247,62 +1288,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;
@@ -1344,7 +1329,7 @@ h3.variant {
        display: block;
 }
 
-.notable-traits .docblock code.content{
+.notable-traits .docblock code.content {
        margin: 0;
        padding: 0;
        font-size: 1.25rem;
@@ -1378,27 +1363,19 @@ pre.rust {
 }
 
 #titles {
-       height: 35px;
+       display: flex;
+       flex-direction: row;
+       gap: 1px;
+       margin-bottom: 4px;
 }
 
 #titles > button {
-       float: left;
-       width: 33.3%;
        text-align: center;
        font-size: 1.125rem;
        cursor: pointer;
        border: 0;
        border-top: 2px solid;
-}
-
-#titles > button:first-child:last-child {
-       margin-right: 1px;
-       width: calc(100% - 1px);
-}
-
-#titles > button:not(:last-child) {
-       margin-right: 1px;
-       width: calc(33.3% - 1px);
+       flex: 1;
 }
 
 #titles > button > div.count {
@@ -1466,9 +1443,7 @@ pre.rust {
        border-radius: 2px;
        cursor: pointer;
 }
-#settings-menu {
-       padding: 0;
-}
+
 #settings-menu > a, #help-button > button {
        padding: 5px;
        height: 100%;
@@ -1545,10 +1520,6 @@ kbd {
        cursor: default;
 }
 
-#implementations-list > h3 > span.in-band {
-       width: 100%;
-}
-
 #main-content > ul {
        padding-left: 10px;
 }
@@ -1719,7 +1690,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;
        }
 
@@ -1760,7 +1731,6 @@ in storage.js plus the media query with (min-width: 701px)
                padding-top: 0px;
        }
 
-       .rustdoc,
        .main-heading {
                flex-direction: column;
        }
@@ -1891,28 +1861,12 @@ in storage.js plus the media query with (min-width: 701px)
                margin-top: 10px;
        }
 
-       #search {
-               margin-left: 0;
-               padding: 0;
-       }
-
        .anchor {
                display: none !important;
        }
 
-       .notable-traits {
-               position: absolute;
-               left: -22px;
-               top: 24px;
-       }
-
        #titles > button > div.count {
-               float: left;
-               width: 100%;
-       }
-
-       #titles {
-               height: 50px;
+               display: block;
        }
 
        /* Because of ios, we need to actually have a full height sidebar title so the
@@ -2043,15 +1997,6 @@ in storage.js plus the media query with (min-width: 701px)
 }
 
 @media (max-width: 464px) {
-       #titles, #titles > button {
-               height: 73px;
-       }
-
-       #main-content > table td {
-               word-break: break-word;
-               width: 50%;
-       }
-
        #crate-search {
                border-radius: 4px;
        }