summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/themes
AgeCommit message (Collapse)AuthorLines
2022-12-07rustdoc: clean up docblock table CSSMichael Howell-0/+3
* The rule `display: block` had no noticeable effect. Technically, because markdown tables have a tbody and thead, they get wrapped in an [anonymous table box] in the CSS tree, nested within the `<table>` element's block layout box. This rule was added in #87230 to make the table side-scrolling, but this same issue was doubly fixed in #88742 by wrapping it in an explicit `<div>` tag. Since accessibility advocates recommend the wrapper div over marking the table as `display: block`, we'll stick with that. https://adrianroselli.com/2020/11/under-engineered-responsive-tables.html * The rule `width: calc(100% - 2px)` had no visible effect, because the anonymous table box was not affected. * The style is tweaked to basically be the same style GitHub uses. In particular, it adds zebra stripes, and removes dotted borders. [anonymous table box]: https://www.w3.org/TR/CSS2/tables.html#anonymous-boxes
2022-12-01Migrate summary toggle filter to CSS variableGuillaume Gomez-8/+3
2022-11-25rustdoc: revert tooltip background color on light theme to readableMichael Howell-1/+1
text #fff on background #fdffd3 fails the [WCAG color contrast checker], and seems like a mistake in 16b55903ee16503e7026677c169727d1907704c2. [WCAG color contrast checker]: https://accessibleweb.com/color-contrast-checker/
2022-11-24Migrate source code elements style to CSS variablesGuillaume Gomez-20/+7
2022-11-21Migrate search result alias to CSS variablesGuillaume Gomez-24/+9
2022-11-20Migrate kdb colors to CSS variablesGuillaume Gomez-18/+9
2022-11-19Rollup merge of #104604 - GuillaumeGomez:migrate-top-button-to-css-var, ↵Matthias Krüger-27/+6
r=notriddle Migrate top buttons style to CSS variables No UI changes. r? `@notriddle`
2022-11-19Migrate top buttons style to CSS variablesGuillaume Gomez-27/+6
2022-11-17Migrate tooltip style to CSS variablesGuillaume Gomez-29/+7
2022-11-13Rollup merge of #104177 - notriddle:notriddle/js-notable-trait-v2, ↵Yuki Okushi-12/+0
r=GuillaumeGomez rustdoc: use consistent "popover" styling for notable traits Follow-up to #104129 Fixes https://github.com/rust-lang/rust/issues/104313. Preview: https://notriddle.com/notriddle-rustdoc-demos/js-notable-trait-v2/std/iter/trait.Iterator.html#method.step_by ## Before ![image](https://user-images.githubusercontent.com/1593513/200710372-d2d992ce-0bdc-4437-9a2e-379a29df09cf.png) ![image](https://user-images.githubusercontent.com/1593513/200711266-e372b176-daa9-45f3-a022-738ef0a77d3c.png) ## After ![image](https://user-images.githubusercontent.com/1593513/200710601-09b3b717-116f-43c6-b14f-34a8b02b33c0.png) ![image](https://user-images.githubusercontent.com/1593513/200711288-3978cdc1-a6c2-47f6-9216-e22e3c1f5bdf.png)
2022-11-12Use same color for links in no result searchGuillaume Gomez-3/+0
2022-11-12Migrate no result page link color to CSS variablesGuillaume Gomez-13/+3
2022-11-12Rollup merge of #104267 - notriddle:notriddle/checkbox, r=GuillaumeGomezDylan DPC-29/+0
rustdoc: use checkbox instead of switch for settings toggles Preview: http://notriddle.com/notriddle-rustdoc-demos/checkbox/test_dingus/index.html ## Before ![image](https://user-images.githubusercontent.com/1593513/201232887-dee27ef5-b091-49bb-be4a-103d2e7983f3.png) ## After ![image](https://user-images.githubusercontent.com/1593513/201232835-95b40b77-6535-4280-8719-44c992a07772.png) ## Description The switch ("slider") is designed to give the application a "physical" feel, but nothing else in here really followed through. They didn't support the "flick" gesture that real iOS switches support, and the radio buttons that were also used in Rustdoc Settings were a more "classic" form element anyway. Also, while switches are the exclusive toggle design on iOS (since [Apple HIG] reserves checkboxes for Mac only), the [Google Material] guidelines say that lists of switches are bad, and you should just use check boxes. [Apple HIG]: https://developer.apple.com/design/human-interface-guidelines/components/selection-and-input/toggles [Google Material]: https://m3.material.io/components/checkbox/guidelines#6902f23d-ceba-4b19-ae3b-b78b9b01d185
2022-11-11rustdoc: use consistent "popover" styling for notable traitsMichael Howell-12/+0
2022-11-10rustdoc: use checkbox instead of switch for settings togglesMichael Howell-29/+0
The switch is designed to give the application a "physical" feel, but nothing else in here really followed through. They didn't support the "flick" gesture that real iOS switches support, and the radio buttons that were also used in Rustdoc Settings were a more "classic" form element anyway. Also, while "switches" are the exclusive toggle design on iOS (since [Apple HIG] reserves checkboxes for Mac only), the [Google Material] guidelines say that lists of switches are bad, and you should just use check boxes. [Apple HIG]: https://developer.apple.com/design/human-interface-guidelines/components/selection-and-input/toggles [Google Material]: https://m3.material.io/components/checkbox/guidelines#6902f23d-ceba-4b19-ae3b-b78b9b01d185
2022-11-10Migrate :target rules to use CSS variablesGuillaume Gomez-15/+6
2022-11-09Migrate crate-search element to CSS variablesGuillaume Gomez-33/+18
2022-11-06Migrate rust logo filter to CSS variablesGuillaume Gomez-20/+9
2022-11-06Rollup merge of #104014 - GuillaumeGomez:run-button-css-var, r=notriddleMatthias Krüger-30/+12
Migrate test-arrow to CSS variables There should be no UI changes. I kept both `color` and `background-color` properties even though only the ayu theme is actually completely making use of them on hover. r? ``@notriddle``
2022-11-05Migrate test-arrow to CSS variablesGuillaume Gomez-30/+12
2022-11-05Fix search result bottom border colorGuillaume Gomez-0/+3
2022-10-27Migrate line numbers CSS to CSS variablesGuillaume Gomez-31/+9
2022-10-15rustdoc: make the help button a link to a pageMichael Howell-5/+9
This allows you to open the help section in a new browser tab, which is a pretty reasonable thing to want for a documentation page.
2022-10-14Rollup merge of #102914 - ↵Dylan DPC-49/+42
GuillaumeGomez:migrate-css-highlight-without-change, r=notriddle Migrate css highlight without change This is a "previous" version of https://github.com/rust-lang/rust/pull/102663: only migrating to CSS variables, no changes. It's a bit more verbose because rules are not coherent between themes. r? ``@notriddle``
2022-10-11rustdoc: remove unneeded `.content` selector from link colorsMichael Howell-1/+1
Since 98f05a0282625a5fda6e90ebf3b05a4bd7608f65 and b5963f07e611cf2a09a310eb74c1a93adfaeb9de removed color classes from sidebar items, there's no need for the selectors to be so specific any more. This commit does have to change `h1.fqn a` to just be `h1 a`, so that the header link color selector is less specific than the typed link at the end. Since #89506 made docblocks start at `h2`, the main page link header should be the only h1 in the page now.
2022-10-11Migrate highlight style to CSS variablesGuillaume Gomez-49/+42
2022-10-06Migrate search input color to CSS variableGuillaume Gomez-8/+3
2022-10-03Migrate search results theme style to CSS variablesGuillaume Gomez-84/+3
2022-10-03Migrate stab elements style to CSS variablesGuillaume Gomez-20/+6
2022-09-30* Migrate sidebar links color to new CSS theme handlingGuillaume Gomez-63/+6
* Remove specific color handling for ".current" items in the sidebar.
2022-09-26rustdoc: simplify example-line-numbers CSS selectorMichael Howell-3/+3
2022-09-26rustdoc: give `.line-number` / `.line-numbers` meaningful namesMichael Howell-12/+12
2022-09-16Create new CSS variables for links colorGuillaume Gomez-78/+24
2022-09-16Remove unneeded empty ayu CSS rulesGuillaume Gomez-21/+3
2022-09-16Remove unused `.block a.current*` rulesGuillaume Gomez-48/+51
2022-09-16Remove some unused CSS rulesGuillaume Gomez-62/+18
2022-09-09Clean up themes a bit moreGuillaume Gomez-144/+12
2022-09-03Clean up themes CSSGuillaume Gomez-91/+21
2022-09-02Remove unused .toggle-label CSS ruleGuillaume Gomez-3/+0
2022-08-31Rollup merge of #100804 - GuillaumeGomez:search-results-color-ayu, r=notriddleYuki Okushi-3/+4
Fix search results color on hover for ayu theme Before: ![image](https://user-images.githubusercontent.com/3050060/185747851-038d2333-8b01-44a8-a104-ceb7410ac089.png) After: ![image](https://user-images.githubusercontent.com/3050060/185747869-53b502f5-5800-470f-b897-2683f1cdb7ee.png) You can test it [here](https://rustdoc.crud.net/imperio/search-results-color-ayu/foo/index.html?search=item). r? ``@jsha``
2022-08-27Merge duplicated CSS rulesGuillaume Gomez-5/+0
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-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-20Fix hover and focus display for search results on ayu themeGuillaume Gomez-3/+4
2022-08-18Simplify rustdoc themes by relying more on CSS variablesGuillaume Gomez-190/+7
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-7/+36
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``