about summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/themes
AgeCommit message (Collapse)AuthorLines
2022-02-07Fix hover effects in sidebarJacob Hoffman-Andrews-21/+11
The dark and ayu themes have a menu-like highlight on sidebar items. The light theme used to, but it was accidentally lost in the sidebar unification. The change brings back the hover effect in the light theme. It also makes the hover effect apply consistently to all links in the sidebar, including headings. It also simplifies the "In _path_" heading so it's one big link. The breadcrumbs are still readily available at the top of the page.
2022-01-31Rollup merge of #93444 - camelid:rustdoc-css-cleanup, r=GuillaumeGomez,jshaMatthias Krüger-6/+8
Fix some CSS warnings and errors from VS Code There's no such CSS rule as `box-shadow-color`, so I instead copied the whole `box-shadow` property to each rule to make it actually apply. r? `@jsha`
2022-01-29rustdoc: small fixes to mobile navigationJacob Hoffman-Andrews-0/+3
- Make sure the mobile-topbar doesn't overflow its height if the user sets a bigger font. - Make sure the sidebar can be scrolled all the way to the bottom by shortening it to accommodate the mobile-topbar. - Make the item name in the mobile-topbar clickable to go to the top of the page. - Remove excess padding sidebar in mobile mode.
2022-01-29Fix some CSS warnings and errors from VS CodeNoah Lev-6/+8
There's no such CSS rule as `box-shadow-color`, so I instead copied the whole `box-shadow` property to each rule to make it actually apply.
2022-01-25give light-theme fns the correct orange-brown colourConrad Ludgate-1/+1
2022-01-24Rollup merge of #93231 - conradludgate:doc-link-brightness, r=notriddleMatthias Krüger-0/+67
adjust sidebar link brightness Fairly simple change. I've taken the existing link colour and main body background colours, and made sure that the sidebar+link contrast is the same. ayu: - [main content contrast](https://colourcontrast.cc/0f1419/39afd7) - 7.31 - [current sidebar contrast](https://colourcontrast.cc/14191f/39afd7) - 6.97 - [new sidebar contrast](https://colourcontrast.cc/14191f/56b1d9) - 7.30 dark: - [main content contrast](https://colourcontrast.cc/353535/d2991d) - 4.86 - [current sidebar contrast](https://colourcontrast.cc/14191f/d2991d) - 3.19 - [new sidebar contrast](https://colourcontrast.cc/14191f/fdbf35) - 4.87 light: - [main content contrast](https://colourcontrast.cc/ffffff/3873ad) - 4.97 - [current sidebar contrast](https://colourcontrast.cc/f5f5f5/3873ad) - 4.56 - [new sidebar contrast](https://colourcontrast.cc/f5f5f5/356da4) - 4.97
2022-01-23remove duplicate ruleConrad Ludgate-6/+0
2022-01-23tweak all sidebar coloursConrad Ludgate-3/+67
2022-01-23adjust sidebar link brightnessConrad Ludgate-0/+9
2022-01-21Unify search input and buttons sizeGuillaume Gomez-31/+5
2022-01-18Remove horizontal lines at top of pageJacob Hoffman-Andrews-9/+0
They are not needed to separate the search bar and the title, which are visually distinct on their own.
2022-01-18Simplify and unify rustdoc sidebar stylesJacob Hoffman-Andrews-72/+9
This switches to just use size, weight, and spacing to distinguish headings in the sidebar. We no longer use boxes, horizontal bars, or centering to distinguish headings. This makes it much easier to understand the hierarchy of headings, and reduces visual noise. I also refactored how the mobile topbar works. Previously, we tried to shift around elements from the sidebar to make the topbar. Now, the topbar gets its own elements, which can be styled on their own. This makes styling and reasoning about those elements simpler. Because the heading font sizes are bigger, increase the sidebar width slightly. As a very minor change, removed version from the "All types" page. It's now only on the crate page.
2022-01-17Rustdoc style cleanupsJacob Hoffman-Andrews-2/+9
- Make "since" version numbers grey again (regressed in #92602). - Remove unneeded selectors for when crate filter dropdown is a sibling of search-input. - Crate filter dropdown doesn't need to be 100% width on mobile. - Only build crate filter dropdown when there is more than one crate. - Remove unused addCrateDropdown.
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-7/+3
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-08Make source links look cleanerJacob Hoffman-Andrews-7/+3
Change from syntaxy-looking [src] to the plain word "source".
2022-01-05Simplify :target CSS selectorGuillaume Gomez-12/+3
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-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-11-29rustdoc: show logo in source sub navcynecx-3/+3
2021-11-29rustdoc: fix theme colorscynecx-3/+3
2021-11-29rustdoc: merge source sidebar into main sidebarcynecx-1/+1
2021-11-24Fix more <a> colorGuillaume Gomez-0/+6
2021-11-22Rollup merge of #91102 - jsha:theme-anchor, r=GuillaumeGomezMatthias Krüger-24/+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-22Set color for <a> in a more straightforward wayJacob Hoffman-Andrews-24/+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-17Make scrollbar in the sidebar always visible for visual consistencyGuillaume Gomez-3/+3
2021-10-31Hide search bar in noscript.cssJacob Hoffman-Andrews-12/+0
Also, remove the highlighting of the search bar in disabled state. This reduces flicker when loading a page.
2021-10-23Rollup merge of #85833 - willcrichton:example-analyzer, r=jyn514Matthias Krüger-0/+38
Scrape code examples from examples/ directory for Rustdoc Adds support for the functionality described in https://github.com/rust-lang/rfcs/pull/3123 Matching changes to Cargo are here: https://github.com/rust-lang/cargo/pull/9525 Live demo here: https://willcrichton.net/example-analyzer/warp/trait.Filter.html#method.and
2021-10-18* Remove left margin on items declaration at the top of their documentation pageGuillaume Gomez-3/+3
* Rename "type-decl" into "item-decl" to reflect the change of usage
2021-10-06Add styles for non-white themesWill Crichton-0/+38
Tweak colors Tabs New link heading style
2021-10-06Restore h1 styles, which got accidentally removed.Mukund Lakshman-3/+3
2021-10-04librustdoc: Use correct heading levels.Mukund Lakshman-3/+3
- Avoid multiple <h1>s on a page. - The <h#> tags should follow a semantic hierarchy. - Cap at h6 (no h7)
2021-09-17Add rustdoc version into the help popupGuillaume Gomez-6/+6
2021-09-12Fix invalid background for jump-to-def links in source code pagesGuillaume Gomez-1/+1
2021-08-28Fix code blocks color in ayu themeGuillaume Gomez-1/+1
2021-08-17Add background-color on clickable definitions in source codeGuillaume Gomez-0/+9
2021-08-08Fix heading colours in Ayu themeKlim Tsoutsman-1/+1
Closes #87828 The issue seems to stem from #87210 where code headings were changed from a heading containing code to a heading with the `code-header` class. `rustdoc.css` was updated, but `ayu.css` was missed.
2021-08-03Rustdoc accessibility: use an icon for the [-]/[+] controlsMichael Howell-0/+10
This way, we can show the plus and minus buttons on screens, while voice control will read off actual words "Collapse" and "Expand" instead of reading "open brace minus close brace" and "open brace plus close brace". Part of #87059
2021-07-25Rustdoc accessibility: use real headers for doc itemsbors-3/+3
Part of #87059 Partially reverts #84703 Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
2021-07-18Fix <table> overflow in doc blocksGuillaume Gomez-3/+3
2021-07-14Rollup merge of #87125 - GuillaumeGomez:ayu-code-color, r=notriddleGuillaume Gomez-1/+1
Fix Ayu theme <code> color Fixes #87072 (the second regression). r? `@notriddle`
2021-07-14Fix color for <code> which are not in doc blocksGuillaume Gomez-1/+1
2021-07-13Fix color for keyword/primitive search resultGuillaume Gomez-3/+3
2021-07-13Fix search result description text color for ayu themeGuillaume Gomez-1/+1
2021-07-07Clean up rustdoc static filesGuillaume Gomez-0/+1555