about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css
AgeCommit message (Collapse)AuthorLines
2022-11-04Rollup merge of #103940 - ↵Matthias Krüger-1/+0
notriddle:notriddle/main-content-item-info-margin-top, r=GuillaumeGomez rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }` When this line was added in 04b4c40682c01cad8f9bc8d5b3907be91d6f81d4, it overrode a negative `margin-top` that was set on it by default. https://github.com/rust-lang/rust/blob/04b4c40682c01cad8f9bc8d5b3907be91d6f81d4/src/librustdoc/html/static/rustdoc.css#L500-L516 That negative top margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.
2022-11-04Rollup merge of #103938 - notriddle:notriddle/search-results-border-bottom, ↵Matthias Krüger-2/+1
r=GuillaumeGomez rustdoc: clean up hardcoded CSS border color on search results Hardcoded colors in rustdoc.css should usually be avoided. Preview: http://notriddle.com/notriddle-rustdoc-demos/border-bottom-search/test_dingus/?search=test
2022-11-04Rollup merge of #103905 - notriddle:notriddle/sidebar-elems-background, ↵Matthias Krüger-1/+0
r=GuillaumeGomez rustdoc: remove redundant mobile CSS `.sidebar-elems { background }` The exact same background is already set for its parent, the `nav.sidebar`.
2022-11-03rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }`Michael Howell-1/+0
When this line was added in 04b4c40682c01cad8f9bc8d5b3907be91d6f81d4, it overrode a negative `margin-top` that was set on it by default. https://github.com/rust-lang/rust/blob/04b4c40682c01cad8f9bc8d5b3907be91d6f81d4/src/librustdoc/html/static/rustdoc.css#L500-L516 That negative top margin was removed in 593d6d1cb15c55c88319470dabb40126c7b7f1e2.
2022-11-03rustdoc: clean up hardcoded CSS border color on search resultsMichael Howell-2/+1
Hardcoded colors in rustdoc.css should usually be avoided.
2022-11-02rustdoc: remove redundant mobile CSS `.sidebar-elems { background }`Michael Howell-1/+0
The exact same background is already set for its parent, the `nav.sidebar`.
2022-11-02Rollup merge of #103890 - notriddle:notriddle/mobile-rustdoc-padding-top, ↵Matthias Krüger-1/+0
r=GuillaumeGomez rustdoc: remove unused mobile CSS `.rustdoc { padding-top: 0 }` When this rule was added in dd437ee6ed81f85c715bf415d261feca484bb39f, as `body { padding-top: 0 }`, the desktop body tag had non-zero top padding. This padding was removed in 135281ed1525db15edd8ebd092aa10aa40df2386. This rule no longer overrides a rule in rustdoc's desktop styles, and also doesn't override the UA stylesheet, since the [HTML standard] has only margin, not padding, on the page body. [HTML standard]: https://html.spec.whatwg.org/multipage/rendering.html#the-page
2022-11-02rustdoc: remove unused mobile CSS `.rustdoc { padding-top: 0 }`Michael Howell-1/+0
When this rule was added in dd437ee6ed81f85c715bf415d261feca484bb39f, as `body { padding-top: 0 }`, the desktop body tag had non-zero top padding. This padding was removed in 135281ed1525db15edd8ebd092aa10aa40df2386. This rule no longer overrides a rule in rustdoc's desktop styles, and also doesn't override the UA stylesheet, since the [HTML standard] has only margin, not padding, on the page body. [HTML standard]: https://html.spec.whatwg.org/multipage/rendering.html#the-page
2022-11-01rustdoc: simplify mobile item-table CSSMichael Howell-8/+1
Using flexbox in column direction is needlessly complicated, since no special flex powers are being used here. Just use regular block layout. This should result in no visible changes.
2022-11-01Rollup merge of #103817 - notriddle:notriddle/attribute-css, r=GuillaumeGomezDylan DPC-1/+1
rustdoc: rename syntax highlighting CSS class `attribute` to `attr` Link classes use the abbreviation `attr` ... https://github.com/rust-lang/rust/blob/2afca78a0b03db144c5d8b9f8868feebfe096309/src/librustdoc/html/static/css/rustdoc.css#L255-L259 ... so why does syntax highlighting use the full word? https://github.com/rust-lang/rust/blob/2afca78a0b03db144c5d8b9f8868feebfe096309/src/librustdoc/html/static/css/rustdoc.css#L1095-L1097
2022-11-01Rollup merge of #103813 - notriddle:notriddle/search-results-clear-both, ↵Dylan DPC-2/+0
r=GuillaumeGomez rustdoc: remove unnecessary CSS `.search-results { clear: both }` Since the tabs use flexbox instead of float as of 44d9b8d07014d976c88f541dbe0af37e64e37bdd, clearing does nothing.
2022-11-01Rollup merge of #103793 - notriddle:notriddle/rustdoc-toggle-in-impl-items, ↵Yuki Okushi-6/+8
r=GuillaumeGomez rustdoc: add margins to all impl-item toggles, not just methods Fixes #103782 ## Before ![image](https://user-images.githubusercontent.com/1593513/198943087-8cab8b25-2092-49d6-89b4-caa2989dedf0.png) ## After ![image](https://user-images.githubusercontent.com/1593513/198943111-bc08c2d6-f058-4362-b999-0caf09eb93bf.png)
2022-10-31rustdoc: remove left border from `.src-line-numbers > a`Michael Howell-3/+5
2022-10-31rustdoc: change `.src-line-numbers > span` to `.src-line-numbers > a`Michael Howell-3/+2
This allows people to treat them like real links, such as right-click to copy URL, and makes the line numbers in a scraped example work at all, when before this commit was added, they had the clickable pointer cursor but did not actually do anything when clicked.
2022-10-31rustdoc: rename syntax highlighting CSS class `attribute` to `attr`Michael Howell-1/+1
Link classes use the abbreviation `attr`, so why shouldn't syntax highlighting?
2022-10-31rustdoc: remove unnecessary CSS `.search-results { clear: both }`Michael Howell-2/+0
Since the tabs use flexbox instead of float as of 44d9b8d07014d976c88f541dbe0af37e64e37bdd, clearing does nothing.
2022-10-30rustdoc: add margins to all impl-item toggles, not just methodsMichael Howell-6/+8
Fixes #103782
2022-10-30Rollup merge of #101944 - notriddle:notriddle/toggle-all-docs, ↵Michael Howell-4/+11
r=jsha,GuillaumeGomez rustdoc: clean up `#toggle-all-docs` This change converts the element from an `<a>` link to a button. It's pretty much directly trading slightly more CSS for slightly less HTML, and it's also semantically correct (so you don't get a broken "bookmark" option when you right click on it). While doing this, I also got rid of the unnecessary `class="inner"` attribute on the inner span. There was a style targeting `.collapse-toggle > .inner`, but no CSS ever targeted the `#toggle-all-docs > .inner`. Preview: https://notriddle.com/notriddle-rustdoc-test/button-toggle-all-docs/index.html
2022-10-30Rollup merge of #103740 - notriddle:notriddle/search-results-padding-bottom, ↵Dylan DPC-1/+0
r=Dylan-DPC rustdoc: remove unnecessary CSS `.search-results { padding-bottom }` There's nothing underneath it anyway. The conversation on #84462 never really spelled out why it was added.
2022-10-30Rollup merge of #103737 - notriddle:notriddle/margin, r=GuillaumeGomezMatthias Krüger-10/+3
rustdoc: use CSS margin/padding shorthand when all are being set
2022-10-30Rollup merge of #103722 - GuillaumeGomez:cleanup-code-example-css, r=notriddleMatthias Krüger-21/+12
Fix z-indexes of code example feature and cleanup its CSS When reviewing https://github.com/rust-lang/rust/pull/103650, I realized that the `z-index`es of this feature were completely broken: ![Screenshot from 2022-10-28 10-55-27](https://user-images.githubusercontent.com/3050060/198826360-0c5cbe5a-ea8e-452a-9504-38d3da3615e6.png) This PR fixes it by reducing the value of value under the one used for `.popover` (it could be completely removed but then it wouldn't be displayed as nicely). There was also a lot of duplicated CSS so I merged the rules. r? `@notriddle`
2022-10-29rustdoc: add hash to filename of toolchain filesJacob Hoffman-Andrews-12/+12
All static files used by rustdoc are now stored in static.files/ and include a hash of their contents. They no longer include the contents of the --resource-suffix flag. This clarifies caching semantics. Anything in static.files can use Cache-Control: immutable because any updates will show up as a new URL. Invocation-specific files like crates-NN.js, search-index-NN.js, and sidebar-items-NN.js still get the resource suffix. The --disable-minification flag is removed because it would vary the output of static files based on invocation flags. Instead, for rustdoc development purposes it's preferable to symlink static files to a non-minified copy for quick iteration.
2022-10-29rustdoc: remove unnecessary `.search-results { padding-bottom }`Michael Howell-1/+0
There's nothing underneath it anyway. The conversation on b615c0c85469c94041a5e68b9d8b68dcf799f9f1 never really spelled out why it was added.
2022-10-29rustdoc: use CSS margin/padding shorthand when all are being setMichael Howell-10/+3
2022-10-29Fix z-indexes of code example feature and cleanup its CSSGuillaume Gomez-21/+12
2022-10-29Rollup merge of #103663 - notriddle:notriddle/search-container, r=GuillaumeGomezMatthias Krüger-12/+7
rustdoc: remove redundant CSS/DOM `div.search-container` Preview: https://notriddle.com/notriddle-rustdoc-demos/search-container/test_dingus/fn.test.html This wrapper DIV was originally added in 89e1fb322321c05497caa01372ceb7d5b57fa680, when it allowed the search bar's size to be calculated without using `calc()`. This `width` hack can be removed using flexbox.
2022-10-28Rollup merge of #103643 - notriddle:notriddle/summary-focus-visible, ↵Matthias Krüger-4/+2
r=GuillaumeGomez rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags We really shouldn't be overriding this kind of stuff unless the browser default is really broken (like outlining the thing that isn't clickable). This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.
2022-10-28Rollup merge of #103585 - GuillaumeGomez:source-line-css, r=notriddleMatthias Krüger-31/+17
Migrate source line numbers CSS to CSS variables Part of https://github.com/rust-lang/rust/pull/98460. No UI changes. r? ``@notriddle``
2022-10-27rustdoc: remove redundant `div.search-container`Michael Howell-12/+7
This wrapper DIV was originally added in 89e1fb322321c05497caa01372ceb7d5b57fa680, when it allowed the search bar's size to be calculated without using `calc()`. This `width` hack can be removed using flexbox.
2022-10-27rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tagsMichael Howell-4/+2
We really shouldn't be overriding this kind of stuff unless the browser default is really broken (like outlining the thing that isn't clickable). This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.
2022-10-27Rollup merge of #103616 - rust-lang:notriddle/moz-box-sizing, r=GuillaumeGomezMatthias Krüger-3/+1
rustdoc: remove CSS workaround for Firefox 29 CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/ This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/
2022-10-27Migrate line numbers CSS to CSS variablesGuillaume Gomez-31/+17
2022-10-27Rollup merge of #103592 - notriddle:notriddle/notable-traits-notable, ↵Matthias Krüger-1/+1
r=GuillaumeGomez rustdoc: remove redundant CSS selector `.notable-traits .notable` The margin was already being set to 0 only a few lines lower.
2022-10-26rustdoc: remove CSS workaround for Firefox 29Michael Howell-3/+1
CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/ This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/
2022-10-27Rollup merge of #103537 - notriddle:notriddle/line-numbers, r=GuillaumeGomezYuki Okushi-32/+19
rustdoc: combine shared CSS between `.*-line-numbers` Example: https://notriddle.com/notriddle-rustdoc-demos/line-numbers/test_dingus/fn.test.html This PR should result in no visible changes. The example is here, so it can be easily tested in different browsers.
2022-10-26rustdoc: remove redundant CSS selector `.notable-traits .notable`Michael Howell-1/+1
The margin was already being set to 0 only a few lines lower.
2022-10-26Update src/librustdoc/html/static/css/rustdoc.cssMichael Howell-1/+2
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com>
2022-10-25rustdoc: add visible focus outline to rustdoc-toggleMichael Howell-0/+8
The change in opacity is inconsistent with most of rustdoc, which uses default browser styles for the focus outline. Unfortunately, just using the default focus outline here won't work, because it gets applied to the summary itself instead of the pseudo-element "real button."
2022-10-25rustdoc: combine shared CSS between `.*-line-numbers`Michael Howell-32/+19
2022-10-25Rollup merge of #103494 - notriddle:notriddle/test-arrow-hover, r=GuillaumeGomezYuki Okushi-3/+0
rustdoc: remove redundant CSS `a.test-arrow:hover` In 4b402dbe690dd00f567542ca9e41042826a168b5, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632052298f9c84cc12ac5afcb23786ae1d3d changed the pro-underline rule to exclude the test-arrow link anyway.
2022-10-25Rollup merge of #103493 - notriddle:notriddle/source-sidebar-logo, ↵Yuki Okushi-4/+4
r=GuillaumeGomez rustdoc: remove unused `.sidebar-logo` DOM on source pages
2022-10-24rustdoc: remove redundant CSS `a.test-arrow:hover`Michael Howell-3/+0
In 4b402dbe690dd00f567542ca9e41042826a168b5, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632052298f9c84cc12ac5afcb23786ae1d3d changed the pro-underline rule to exclude the test-arrow link anyway.
2022-10-24rustdoc: fix weird toggle-all-docs style in iOSMichael Howell-0/+3
2022-10-24rustdoc: clean up `#toggle-all-docs`Michael Howell-4/+8
This change converts the element from an `<a>` link to a button. It's pretty much directly trading slightly more CSS for slightly less HTML, and it's also semantically correct (so you don't get a broken "bookmark" option when you right click on it). While doing this, I also got rid of the unnecessary `class="inner"` attribute on the inner span. There was a style targeting `.collapse-toggle > .inner`, but no CSS ever targeted the `#toggle-all-docs > .inner`.
2022-10-24rustdoc: remove unused `.sidebar-logo` DOM on source pagesMichael Howell-4/+4
2022-10-23rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }`Michael Howell-1/+0
This rule, added in 49e6db7f3510a99ab3d3723b2430add985629c39, overrode a rule in normalize.css. https://github.com/rust-lang/rust/blob/49e6db7f3510a99ab3d3723b2430add985629c39/src/librustdoc/html/static/normalize.css#L169-L175 When normalize.css was updated, this rule went away. https://github.com/necolas/normalize.css/commit/a8edd0c5aa06b905e8e1550fd6a5c01e46375194
2022-10-23Rollup merge of #103424 - ↵Michael Howell-1/+0
notriddle:notriddle/code-header-border-bottom-none, r=GuillaumeGomez rustdoc: remove no-op CSS `.code-header { border-bottom: none }` The code headers are always h3 or h4, which don't have border-bottom by default anyway.
2022-10-22rustdoc: remove no-op CSS `.code-header { border-bottom: none }`Michael Howell-1/+0
The code headers are always h3 or h4, which don't have border-bottom by default anyway.
2022-10-21rustdoc: remove unused CSS class `.result-description`Michael Howell-3/+3
It was added to the CSS in d8de2b4c338471aacaf0e8a096f9a7148b146ab4, but was never actually used in that PR.
2022-10-22Rollup merge of #103370 - notriddle:notriddle/out-of-band, r=GuillaumeGomezMatthias Krüger-1/+0
rustdoc: remove unused CSS `.out-of-band { font-weight: normal }` This CSS was added in 083c3952e0d5473cd5c41a9eb7b4ffca18cc8e5f to normalize the appearance of out-of-band elements that were nested directly below headers. Now, the only use of `out-of-band` is in the main page header, and it is nested below a wrapper, not the `<h1>` itself.