about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css
AgeCommit message (Collapse)AuthorLines
2022-01-12Rollup merge of #92764 - GuillaumeGomez:fix-rust-logo-style, r=jshaMatthias Krüger-3/+3
Fix rust logo style The style on the rust logo is currently broken: ![Screenshot from 2022-01-11 13-36-30](https://user-images.githubusercontent.com/3050060/148946754-a1a57253-bed0-44cf-a41c-83e0eecbd6b5.png) With this fix, we're back to normal: ![Screenshot from 2022-01-11 13-42-07](https://user-images.githubusercontent.com/3050060/148946778-99f44678-aac1-419f-bb8c-ffa837e0c1ee.png) I also used a GUI test to prevent future silent regressions. r? ```@jsha```
2022-01-11Fix style for rust logoGuillaume Gomez-3/+3
2022-01-10Rollup merge of #92602 - jsha:source-link-2, r=GuillaumeGomezMatthias Krüger-19/+23
Make source links look cleaner Change from syntaxy-looking [src] to the plain word "source". Change the syntaxy-looking `[-]` at the top of the page to say "collapse". Reduce opacity of rightside content. Part of #59851 r? `@GuillaumeGomez` Demo: https://rustdoc.crud.net/jsha/source-link-2/std/string/struct.String.html [Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/display.20of.20source.20link).
2022-01-09Rollup merge of #92490 - jsha:crates-in-results, r=GuillaumeGomezMatthias Krüger-6/+12
Move crate drop-down to search results page This reduces clutter on doc pages. Part of #59840 r? ```@GuillaumeGomez``` Demo: https://rustdoc.crud.net/jsha/crates-in-results/std/index.html?search=str
2022-01-08Make source links look cleanerJacob Hoffman-Andrews-19/+23
Change from syntaxy-looking [src] to the plain word "source".
2022-01-07Rollup merge of #92610 - GuillaumeGomez:css-class-instead-of-inline-style, ↵Eric Huss-0/+4
r=jsha Create CSS class instead of using inline style for search results I saw this change in the update you proposed in https://github.com/rust-lang/rust/pull/92404. :) r? ``@jsha``
2022-01-06Create CSS class instead of using inline style for search resultsGuillaume Gomez-0/+4
2022-01-06Rollup merge of #92404 - GuillaumeGomez:src-font-size, r=jshaMatthias Krüger-13/+7
Fix font size for [src] links in headers Fixes #90384. cc `@jsha` r? `@camelid`
2022-01-06Rollup merge of #92058 - jsha:run-on-hover, r=GuillaumeGomezMatthias Krüger-1/+4
Make Run button visible on hover This slightly reduces the noisiness of doc pages, making them easier to read. Demo: https://rustdoc.crud.net/jsha/run-on-hover/std/string/struct.String.html [Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.22Run.22.20button.20visible.20on.20hover). Part of #59845
2022-01-05Simplify :target CSS selectorGuillaume Gomez-12/+3
2022-01-05Move crate drop-down to search results pageJacob Hoffman-Andrews-6/+12
This reduces clutter on doc pages.
2022-01-05Fix font size for [src] links in headersGuillaume Gomez-1/+4
2022-01-05Make Run button visible on hoverJacob Hoffman-Andrews-1/+4
This slightly reduces the noisiness of doc pages, making them easier to read.
2022-01-02Set font size proportional to user's font sizeJacob Hoffman-Andrews-53/+58
According to MDN (https://developer.mozilla.org/en-US/docs/Web/CSS/font-size), > To maximize accessibility, it is generally best to use values that > are relative to the user's default font size. > Defining font sizes in px is not accessible, because the user cannot > change the font size in some browsers. Note that changing font size (in browser or OS settings) is distinct from the zoom functionality triggered with Ctrl/Cmd-+. Zoom functionality increases the size of everything on the page, effectively applying a multiplier to all pixel sizes. Font size changes apply to just text. For relative font sizes, we could use `em`, as we do in several places already. However that has a problem of "compounding" (see MDN article for details). The compounding problem is nicely solved by `rem`, which make font sizes relative to the root element, not the parent element. Since we were using a hodge-podge of pixel sizes, em, rem, and percentage sizes before, this change switching everything to rem, while keeping the same size relative to our old default of 16px. 16px is still the default on most browsers, for users that haven't set a larger or smaller font size.
2021-12-31Rollup merge of #92440 - GuillaumeGomez:fix-mobile-toggles, r=jshaMatthias Krüger-0/+10
Fix mobile toggles position Before: ![Screenshot from 2021-12-29 18-53-33](https://user-images.githubusercontent.com/3050060/147764842-082f6fa2-b631-4c47-ba34-ced76fe8494f.png) After: ![Screenshot from 2021-12-29 18-52-48](https://user-images.githubusercontent.com/3050060/147764853-13046330-2442-4fad-b26a-84c167711b54.png) r? `@jsha`
2021-12-31Rollup merge of #91480 - jsha:fewer-colors, r=GuillaumeGomezMatthias Krüger-59/+73
rustdoc: use smaller number of colors to distinguish items This reduces visual distractions when reading method signatures. As discussed in https://github.com/rust-lang/rust/issues/59845#issuecomment-974757191, this categorizes items into one of six colors (down from thirteen): - method, function (ochre `#AD7C37`) - trait, trait alias (dark slate blue `#6E4FC9`) - enum, struct, type alias, union, primitive (maroon `#AD378A`) - static, module, keyword, associated type, foreign type (steel blue `#3873AD`) - macro (green `#068000`) - generic params, self, Self (unmarked black `#000000`) I slightly tweaked the actual color values so they'd have the same lightness (previously the trait color stood out much more than the others). And I made the color for links in general consistently use steel blue (previously there was a slightly different color for "search-failed"). The ayu and dark themes have been updated according to the same logic. I haven't changed any of the color values in those themes, just their assignment to types. Demo: https://rustdoc.crud.net/jsha/fewer-colors/std/string/struct.String.html https://rustdoc.crud.net/jsha/fewer-colors/std/vec/struct.Vec.html https://rustdoc.crud.net/jsha/fewer-colors/std/io/trait.Read.html https://rustdoc.crud.net/jsha/fewer-colors/std/iter/trait.Iterator.html
2021-12-30Fix display of toggles on mobileGuillaume Gomez-0/+10
2021-12-15Rollup merge of #91905 - GuillaumeGomez:source-code-page-sidebar, r=jshaMatthias Krüger-2/+10
Fix source code page sidebar on mobile Current broken behaviour: https://user-images.githubusercontent.com/3050060/145984316-35c82353-5bab-4dc6-9ac6-63ea7e5c27d8.mp4 Fixed: https://user-images.githubusercontent.com/3050060/145984329-8be1127b-d707-424d-ac3c-c1fb3c48a093.mp4 r? `@jsha`
2021-12-14Fix sidebar in source code pageGuillaume Gomez-2/+10
2021-12-13Rollup merge of #91699 - jsha:webkit-appearance-search-input, r=GuillaumeGomezMatthias Krüger-0/+4
Add `-webkit-appearance: none` to search input This fixes an issue when displaying on iPad, where the search box had no borders. r? ``@GuillaumeGomez`` Demo https://rustdoc.crud.net/jsha/webkit-appearance-search-input/std/string/struct.String.html
2021-12-12Add -webkit-appearance: none to search inputJacob Hoffman-Andrews-0/+4
This fixes an issue when displaying on iPad, where the search box had no borders.
2021-12-10Split CSS classes for "typedef" vs "associatedtype".Jacob Hoffman-Andrews-7/+23
2021-12-08Rollup merge of #91534 - jsha:heading-color, r=GuillaumeGomezMatthias Krüger-3/+3
Make rustdoc headings black, and markdown blue Demo: https://rustdoc.crud.net/jsha/heading-color/std/string/index.html#structs https://rustdoc.crud.net/jsha/heading-color/std/string/struct.String.html#examples Fixes #91304 r? ```@camelid``` /cc ```@GuillaumeGomez``` (Note: we may want to make rustdoc headings and markdown headings the same color -- #90245 -- but we would want to do that intentionally; this is fixing up a change that did so accidentally)
2021-12-08Change associated type to use link colorJacob Hoffman-Andrews-5/+5
2021-12-04Make rustdoc headings black, and markdown blueJacob Hoffman-Andrews-3/+3
2021-12-03Use fewer colors in rustdoc UIJacob Hoffman-Andrews-57/+55
This reduces visual distractions when reading method signatures.
2021-12-02Rename CSS class main-inner into width-limiterGuillaume Gomez-3/+3
2021-12-02Rename ID "main" into "main-content"Guillaume Gomez-11/+11
2021-12-02Fix remaining bugsGuillaume Gomez-6/+21
2021-11-29rustdoc: show logo in source sub navcynecx-3/+38
2021-11-29rustdoc: rework source sidebarcynecx-31/+48
2021-11-29rustdoc: fix tabs in csscynecx-5/+5
2021-11-29rustdoc: don't use overflow for main, instead make the sidebar stickycynecx-16/+14
2021-11-29rustdoc: make source sidebar collapse by defaultcynecx-1/+1
2021-11-29rustdoc: fix theme colorscynecx-3/+3
2021-11-29rustdoc: merge source sidebar into main sidebarcynecx-33/+32
2021-11-29rustdoc: fix source viewcynecx-4/+43
2021-11-29rustdoc: use flexbox to layout sidebar and main contentcynecx-48/+43
2021-11-27Rollup merge of #91062 - jsha:static-file-replace, r=jyn514,GuillaumeGomezMatthias Krüger-0/+11
rustdoc: Consolidate static-file replacement mechanism There were a few places in rustdoc where we would take static JS or CSS and rewrite it at doc generation time to insert values. This consolidates all the CSS instances into one CSS file and replaces the JS examples with data- attributes on the rustdoc-vars div. Demo https://rustdoc.crud.net/jsha/static-file-replace/test_docs/ r? ``@GuillaumeGomez``
2021-11-26Update the first heading indent rule so it is only applied on the first ↵Guillaume Gomez-4/+6
heading of the top doc block
2021-11-25Fix invalid scrollbar display on source code pageGuillaume Gomez-0/+4
2021-11-24Consistentize the system for image URLs in CSS.Jacob Hoffman-Andrews-0/+11
2021-11-24Rollup merge of #91179 - GuillaumeGomez:a-color, r=jshaGuillaume Gomez-0/+6
Fix more <a> color Fixes #91175. Another bug I saw is: ![Screenshot from 2021-11-24 11-41-27](https://user-images.githubusercontent.com/3050060/143239845-f173cfeb-8f5c-4215-a5af-b71d4e1bcd84.png) I fixed it as well. r? ``@jsha``
2021-11-24Rollup merge of #91075 - jsha:chill-item-info, r=GuillaumeGomezGuillaume Gomez-3/+1
Reduce prominence of item-infos Fixes #59853 - Remove border. - Reduce size of emoji slightly. - Remove details disclosure for unstable reason. This was inconsistent with our other details disclosures, and the detail revealed was usually better explained by clicking on the issue link. Demo: https://rustdoc.crud.net/jsha/chill-item-info/std/mem/union.MaybeUninit.html#method.slice_assume_init_ref Compare vs: https://doc.rust-lang.org/nightly/std/mem/union.MaybeUninit.html#method.slice_assume_init_ref <img src="https://user-images.githubusercontent.com/220205/142717815-09828c9e-6ff4-445a-8ccc-31e028fd4985.png" width=700>
2021-11-24Fix more <a> colorGuillaume Gomez-0/+6
2021-11-22Rollup merge of #91102 - jsha:theme-anchor, r=GuillaumeGomezMatthias Krüger-28/+39
Set color for <a> in a more straightforward way. Previously, we set the default color for <a> tags to black, and then had an override with a bunch of not() clauses to set anchors in docblocks to blue. Instead, we should set the default color for <a> to blue (or equivalent in other themes), and override it for places like the sidebar or search results, where we don't want them to be styled as links. Demo at https://rustdoc.crud.net/jsha/theme-anchor/std/string/struct.String.html. This should result in no visible changes. r? `@GuillaumeGomez`
2021-11-22Auto merge of #91099 - jsha:cleanup-undocumented, r=GuillaumeGomezbors-33/+4
Remove styles for details.undocumented The Rust code that generated tags with that class was deleted in 10bafe1975e53769180701508e2b8cd3a3b34a0e. r? `@GuillaumeGomez`
2021-11-22Set color for <a> in a more straightforward wayJacob Hoffman-Andrews-28/+39
Previously, we set the default color for <a> tags to black, and then had an override with a bunch of not() clauses to set anchors in docblocks to blue. Instead, we should set the default color for <a> to blue (or equivalent in other themes), and override it for places like the sidebar or search results, where we don't want them to be styled as links.
2021-11-20Remove styles for details.undocumentedJacob Hoffman-Andrews-33/+4
The Rust code that generated tags with that class was deleted in 10bafe1975e53769180701508e2b8cd3a3b34a0e.
2021-11-20Rollup merge of #90983 - GuillaumeGomez:sidebar-scrollbar, r=jshaMatthias Krüger-4/+4
Make scrollbar in the sidebar always visible for visual consistency Fixes #90943. I had to add a background in `dark` and `ayu` themes, otherwise it was looking strange (like an invisible margin). So it looks like this: ![Screenshot from 2021-11-17 14-45-49](https://user-images.githubusercontent.com/3050060/142212476-18892ae0-ba4b-48e3-8c0f-4ca1dd2f851d.png) ![Screenshot from 2021-11-17 14-45-53](https://user-images.githubusercontent.com/3050060/142212482-e97b2fad-68d2-439a-b62e-b56e6ded5345.png) Sadly, I wasn't able to add a GUI test to ensure that the scrollbar was always displayed because it seems not possible in puppeteer for whatever reason... I used this method: on small pages (like `lib2/sub_mod/index.html`), comparing `.navbar`'s `clientWidth` with `offsetWidth` (the first doesn't include the sidebar in the computed amount). When checking in the browser, it works fine but in puppeteer it almost never works... In case anyone want to try to solve the bug, here is the puppeteer code: <details> More information about this: I tried another approach which was to get the element in `evaluate` directly (by calling it from `page.evaluate(() => { .. });` directly instead of `parseAssertElemProp.evaluate(e => {...});`. ```js const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto("file:///path/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/lib2/sub_mod/index.html"); await page.waitFor(".sidebar"); let parseAssertElemProp = await page.$(".sidebar"); if (parseAssertElemProp === null) { throw '".sidebar" not found'; } await parseAssertElemProp.evaluate(e => { const parseAssertElemPropDict = {"clientWidth": "192", "offsetWidth":"200"}; for (const [parseAssertElemPropKey, parseAssertElemPropValue] of Object.entries(parseAssertElemPropDict)) { if (e[parseAssertElemPropKey] === undefined || String(e[parseAssertElemPropKey]) != parseAssertElemPropValue) { throw 'expected `' + parseAssertElemPropValue + '` for property `' + parseAssertElemPropKey + '` for selector `.sidebar`, found `' + e[parseAssertElemPropKey] + '`'; } } }).catch(e => console.error(e)); await browser.close(); })(); ``` </details> r? ``@jsha``