about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css
AgeCommit message (Collapse)AuthorLines
2022-08-26rustdoc: remove unused CSS for `hidden-by-*-hider`Michael Howell-6/+0
This CSS seems to have become obsolete with the move to `<details>` tags, and its corresponding JavaScript was removed in aee054d05d8b795d35c0b448a4b731b6507aa459
2022-08-26Rollup merge of #101012 - notriddle:notriddle/variants_table, r=jshaGuillaume Gomez-8/+0
rustdoc: remove unused CSS for `.variants_table` Continuation of #100938 and #101010. This rule was added to support the old, table-based style for displaying enum variants, which are now displayed using headers and paragraphs.
2022-08-26Rollup merge of #100956 - GuillaumeGomez:reduce-rightside-dom-size, r=notriddleGuillaume Gomez-3/+3
Reduce right-side DOM size This is another follow-up of https://github.com/rust-lang/rust/pull/100429 but not in code blocks this time. So the idea is: if there is only one element in the `.rightside` element, there is no need to wrap it, we can just create one node. On each page, I run this JS: `document.getElementsByTagName('*').length`. Important to note: the bigger the number of elements inside the page, the greater the gain. It also doesn't work very nicely on std docs because there are a lot of version annotations. So with this PR, It allows to get the following results: | file name | before this PR | with this PR | diff | |-|-|-|-| | std/default/trait.Default.html | 2189 | 1331 | 39.2% | | std/vec/struct.Vec.html | 14073 | 13842 | 1.7% | | std/fmt/trait.Debug.html | 5313 | 4907 | 7.7% | | std/ops/trait.Index.html | 642 | 630 | 1.9% | | gtk4/WidgetExt | 3269 | 3061 | 6.4% | You can test it [here](https://rustdoc.crud.net/imperio/reduce-rightsize-dom-size/gtk4/prelude/trait.WidgetExt.html). r? `@notriddle`
2022-08-26Rollup merge of #101010 - notriddle:notriddle/multi-column, r=jshaYuki Okushi-10/+0
rustdoc: remove unused CSS for `.multi-column` As a sanity check, [this tool] can be used to run a CSS query across an HTML tree to detect if a selector ever matches (I use compiler-docs and std docs). This isn't good enough, because I also need to account for JavaScript, but this class is never mentioned in any of the JS files, either. According to [blame], this class was added when rustdoc was first written, and, as far as I can tell, was never actually used. [this tool]: https://gitlab.com/notriddle/html-scanner [blame]: https://github.com/rust-lang/rust/blame/4d45b0745ab227feb9000bc15713ade4b99241ea/src/librustdoc/html/static/css/rustdoc.css#L753-L761
2022-08-25rustdoc: remove unused CSS for `.variants_table`Michael Howell-8/+0
Continuation of #100938 and #101010. This rule was added to support the old, table-based style for displaying enum variants, which are now displayed using headers and paragraphs.
2022-08-25rustdoc: remove unused CSS for `.multi-column`Michael Howell-10/+0
As a sanity check, [this tool] can be used to run a CSS query across an HTML tree to detect if a selector ever matches (I use compiler-docs and std docs). This isn't good enough, because I also need to account for JavaScript, but this class is never mentioned in any of the JS files, either. According to [blame], this class was added when rustdoc was first written, and, as far as I can tell, was never actually used. [this tool]: https://gitlab.com/notriddle/html-scanner [blame]: https://github.com/rust-lang/rust/blame/4d45b0745ab227feb9000bc15713ade4b99241ea/src/librustdoc/html/static/css/rustdoc.css#L753-L761
2022-08-25Rollup merge of #100960 - rust-lang:notriddle/ayu-span-code, r=GuillaumeGomezYuki Okushi-1/+1
rustdoc: ayu code color selector more specific According to https://github.com/rust-lang/rust/pull/100960#issuecomment-1225970579, this selector is only really intended to apply to item info. However, it's so broad that it's hard to tell when it deliberately applies vs where it accidentally applies.
2022-08-24Remove the extra DOM level if there is only one child in rightside elementsGuillaume Gomez-3/+3
2022-08-24rustdoc: ayu code color selector more specificMichael Howell-1/+1
According to https://github.com/rust-lang/rust/pull/100960#issuecomment-1225970579, this selector is only really intended to apply to item info. However, it's so broad that it's hard to tell when it deliberately applies vs where it accidentally applies.
2022-08-23rustdoc: remove unused CSS ruleMichael Howell-4/+0
According to [blame], this rule was added to support enum struct variants. However, enum struct variants don't use tables in their design any more, so this rule does nothing. [blame]: https://github.com/rust-lang/rust/blame/87991d5f5d72d6baca490141cb890211ba2f3843/src/librustdoc/html/static/css/rustdoc.css#L748
2022-08-20Rollup merge of #100718 - GuillaumeGomez:fix-item-info, r=jshaMatthias Krüger-0/+1
[rustdoc] Fix item info display Fixes #100369. The solution I came up with was simply to wrap the "text part" of the `item-info` into another span so that `flex` wouldn't mess with it. Live demo is [here](https://rustdoc.crud.net/imperio/fix-item-info/foo/struct.ItemInfo.html). r? ``@jsha``
2022-08-20Fix hover and focus display for search results on ayu themeGuillaume Gomez-3/+4
2022-08-18Fix item-info displayGuillaume Gomez-0/+1
2022-08-18Remove unused CSS ruleGuillaume Gomez-14/+0
2022-08-18Simplify rustdoc themes by relying more on CSS variablesGuillaume Gomez-228/+30
2022-08-14Don't generate ident elements as DOM nodesGuillaume Gomez-7/+3
2022-08-12Rollup merge of #100409 - jsha:highlight-lighter, r=GuillaumeGomezDylan DPC-2/+2
rustdoc: don't generate DOM element for operator In our source page highlighting, we were generating `<span class="op">` tags for all "operators", including e.g. `<` `>` around generic parameters, `*`, `&`. This contributed significantly to DOM size, but we don't actually style `.op` except in the ayu theme. Remove the styles for `.op` in ayu, and stop generating the `<span>`s. This reduces DOM size of an example page[1] from 265,938 HTML elements to 242,165 elements, a 9% reduction. r? ``@GuillaumeGomez`` Demo: (warning - slow!) https://rustdoc.crud.net/jsha/highlight-lighter/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html [1]: https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html
2022-08-11rustdoc: don't generate DOM element for operatorJacob Hoffman-Andrews-2/+2
In our source page highlighting, we were generating `<span class="op">` tags for all "operators", including e.g. `<` `>` around generic parameters, `*`, `&`. This contributed significantly to DOM size, but we don't actually style `.op` except in the ayu theme. Remove the styles for `.op` in ayu, and stop generating the `<span>`s. This reduces DOM size of an example page[1] from 265,938 HTML elements to 242,165 elements, a 9% reduction. [1]: https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html
2022-08-11Rollup merge of #100374 - ↵Matthias Krüger-18/+86
GuillaumeGomez:improve_rustdoc_search_results_page_crates_selection, r=notriddle Improve crate selection on rustdoc search results page Take over of #98855 (screenshots and explanations are there). You can test it [here](https://rustdoc.crud.net/imperio/improve_rustdoc_search_results_page_crates_selection/std/index.html?search=test). cc ``@steffahn`` ``@jsha`` r? ``@notriddle``
2022-08-10rustdoc: make item-infos dimmer on dark theme #93896Jacob Hoffman-Andrews-23/+8
Previously the item-info background colors were too bright for a dark theme, making a bright rectangle that draws the attention.
2022-08-10Two small improvements:Frank Steffahn-3/+2
Fix oversight duplicate property left in CSS (dark theme). Improve wording in comment that mentions `appearance: none`
2022-08-10Improve crate selection on rustdoc search results pageFrank Steffahn-18/+87
Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-08-02Rollup merge of #99779 - GuillaumeGomez:fix-item-info-pos-and-height, ↵Matthias Krüger-1/+9
r=notriddle Fix item info pos and height Fixes https://github.com/rust-lang/rust/issues/98266. Fixes https://github.com/rust-lang/rust/issues/98343. You can test it [here](https://rustdoc.crud.net/imperio/fix-item-info-pos-and-height/lib2/trait.Trait.html). Here is a screenshot of the result: ![Screenshot from 2022-07-26 21-55-53](https://user-images.githubusercontent.com/3050060/181100624-18b8b045-5c25-4c7c-9c44-97d55d29b675.png) r? `@jsha`
2022-07-28Rollup merge of #99810 - GuillaumeGomez:fix-settings-slider-small-width, ↵Dylan DPC-2/+1
r=notriddle Fix settings slider on small width screens Fixes #99794. Screenshot of the fix: ![Screenshot from 2022-07-27 14-17-08](https://user-images.githubusercontent.com/3050060/181250007-55f982d1-89db-45b7-a4f1-0d1729e6a3e3.png) cc `````@jsha````` r? `````@notriddle`````
2022-07-27Rollup merge of #99812 - GuillaumeGomez:fix-headings-colors, r=jsha,notriddleGuillaume Gomez-6/+2
Fix headings colors Fixes #99797. ![image](https://user-images.githubusercontent.com/3050060/181260966-49faf9d3-f6b8-4de4-bc7d-ed9f0467cf68.png) cc `@jsha` r? `@notriddle`
2022-07-27Fix headings borderGuillaume Gomez-5/+1
2022-07-27Fix invalid css property valueGuillaume Gomez-1/+1
2022-07-27Fix settings display on small screen sizeGuillaume Gomez-2/+1
2022-07-26Fix display of item info and unify their heightGuillaume Gomez-1/+9
2022-07-26Rollup merge of #99235 - ↵Matthias Krüger-1/+5
WaffleLapkin:rustdoc_implement_support_for_must_implement, r=GuillaumeGomez rustdoc: Add support for `#[rustc_must_implement_one_of]` This PR adds support for `#[rustc_must_implement_one_of]` attribute added in #92164. There is a desire to eventually use this attribute of `Read`, so making it show up in docs is a good thing. I "stole" the styling from cfg notes, not sure what would be a proper styling. Currently it looks like this: ![2022-07-14_15-00](https://user-images.githubusercontent.com/38225716/178968170-913c1dd5-8875-4a95-9848-b075a0bb8998.png) <details><summary>Code to reproduce</summary> <p> ```rust #![feature(rustc_attrs)] #[rustc_must_implement_one_of(a, b)] pub trait Trait { fn req(); fn a(){ Self::b() } fn b(){ Self::a() } } ``` </p> </details>
2022-07-25Fix sidebar background-color on mobileGuillaume Gomez-1/+0
2022-07-25fix rustdoc-gui testsMaybe Waffle-1/+1
2022-07-24Satisfy theme checkMaybe Waffle-0/+1
2022-07-24Add support for `#[rustc_must_implement_one_of]` to rustdocMaybe Waffle-2/+5
2022-07-22Rollup merge of #99423 - GuillaumeGomez:group-css-font-rule, r=notriddleDylan DPC-12/+9
Group CSS font rule Another CSS cleanup I came by when working on something else. r? ``@notriddle``
2022-07-20Remove CSS transition for search input border-colorGuillaume Gomez-1/+0
2022-07-20Fix CSS on search input focusGuillaume Gomez-3/+21
2022-07-20Fix crate filter select displayGuillaume Gomez-3/+1
2022-07-18Group CSS font ruleGuillaume Gomez-12/+9
2022-07-14Remove unused CSSGuillaume Gomez-46/+6
2022-07-11Continue themes CSS migration over CSS variablesGuillaume Gomez-130/+45
2022-07-11Remove unused CSS rulesGuillaume Gomez-33/+0
2022-07-11Rollup merge of #99114 - GuillaumeGomez:css-cleanup, r=Dylan-DPCMatthias Krüger-7/+3
Group .test-arrow CSS rules and fix rgb/rgba property Surprisingly, the web browsers were handling the `rgb`/`rgba` typo correctly. At least it now is as expected. For the rest, it's simply grouping `.test-arrow` rules. r? ``@Dylan-DPC``
2022-07-10Group .test-arrow CSS rules and fix rgb/rgba propertyGuillaume Gomez-7/+3
2022-07-10Rollup merge of #99086 - GuillaumeGomez:search-result-crate-filter-dropdown, ↵Matthias Krüger-1/+2
r=notriddle Fix display of search result crate filter dropdown In case a crate name is too long, the `<select>` completely overflows its parent. Another problem is that there is left margin on the `select` which break the alignment. You can see both issues here: ![Screenshot from 2022-07-09 15-31-12](https://user-images.githubusercontent.com/3050060/178108959-0eb5af19-ec60-4d34-a2fd-c27147683c78.png) And with the fix: ![Screenshot from 2022-07-09 15-33-37](https://user-images.githubusercontent.com/3050060/178108980-71030a92-84ee-4ee5-98e3-f97d03a6fbaf.png) cc `@jsha` r? `@notriddle`
2022-07-09Fix display of search result crate filter dropdownGuillaume Gomez-1/+2
2022-07-08set all padding for main element in printInfra-1/+1
2022-07-08try to fix tidy issuesInfra-10/+10
2022-07-08improve print stylesInfra-1/+11
this change removes some interactive elements in `@media print` form. more specifically, it removes the source links, the expand/collapse toggle buttons, and the `#copy-path` button. it also adjusts some spacing and removes the `.top-doc` description completely if it's currently collapsed.
2022-07-05Rollup merge of #98776 - notriddle:notriddle/mobile-sidebar-auto-close, ↵Dylan DPC-0/+10
r=GuillaumeGomez rustdoc: improve click behavior of the source code mobile full-screen "sidebar" On desktop, if you open the source code sidebar, it stays open even when you move from page to page. It used to do the same thing on mobile, but I think that's stupid. Since the file list fills the entire screen on mobile, and you can't really do anything with the currently selected file other than dismiss the "sidebar" to look at it, it's safe to assume that anybody who clicks a file in that list probably wants the list to go away so they can see it. Split out separately from #98772