about summary refs log tree commit diff
path: root/src/librustdoc/html/static/themes/light.css
AgeCommit message (Collapse)AuthorLines
2021-07-07Clean up rustdoc static filesGuillaume Gomez-469/+0
2021-06-27Use rustdoc.css for error indexDeadbeef-3/+2
2021-06-16Fix target highlighting in rustdoc.Jacob Hoffman-Andrews-1/+4
Also factor out outer_version and const_outer_version into render_rightside.
2021-06-02Replace h3 for notable traits with divGuillaume Gomez-1/+5
2021-06-01Replace h3 and h4 containing invalid DOMGuillaume Gomez-4/+2
2021-05-25Fix more search results CSS rulesGuillaume Gomez-2/+2
2021-05-19Fix invalid CSS rules for a:hoverGuillaume Gomez-2/+2
2021-05-18Rollup merge of #85407 - GuillaumeGomez:copy-path-display-improvement, r=jshaRalf Jung-3/+12
Improve display for "copy-path" button, making it more discreet As suggested by `@Nemo157` [here](https://github.com/rust-lang/rust/pull/85118#issuecomment-838887670): ![Screenshot from 2021-05-18 11-18-49](https://user-images.githubusercontent.com/3050060/118626882-899ddb00-b7cb-11eb-84c5-ef68dee5e351.png) ![Screenshot from 2021-05-18 11-15-06](https://user-images.githubusercontent.com/3050060/118626880-899ddb00-b7cb-11eb-95c1-2f3bacd22374.png) ![Screenshot from 2021-05-18 11-18-54](https://user-images.githubusercontent.com/3050060/118626885-8a367180-b7cb-11eb-870c-7acdf4259bef.png) ![Screenshot from 2021-05-18 11-15-00](https://user-images.githubusercontent.com/3050060/118626877-89054480-b7cb-11eb-9efc-9a0f153964ce.png) ![Screenshot from 2021-05-18 11-18-58](https://user-images.githubusercontent.com/3050060/118626888-8a367180-b7cb-11eb-91bb-47867cd0f2cc.png) ![Screenshot from 2021-05-18 11-19-00](https://user-images.githubusercontent.com/3050060/118626891-8acf0800-b7cb-11eb-9e3d-d2937b361524.png) r? `@jsha`
2021-05-18Rollup merge of #84462 - jsha:focus-search-results2, r=GuillaumeGomezRalf Jung-21/+25
rustdoc: use focus for search navigation Rather than keeping track of highlighted element inside the JS, take advantage of `.focus()` and the :focus CSS pseudo-class. This required wrapping each row of results in one big `<a>` tag (because anchors can be focused, but table rows cannot). That in turn required moving from a table layout to a div layout with float. This makes it so Ctrl+Enter opens links in new tabs, and using the arrow keys to navigate off the bottom of the page scrolls the rest of the page into view. It also simplifies the keyboard event handling. It eliminates the need for click handlers on the search results, and for tracking mouse movements. This changes the UI treatment of mouse hovering. A hovered element now gets a light grey background, but does not change the focus. It's possible to have two highlighted search results: one that is focused (via keyboard) and one that is hovered (via mouse). Pressing enter will activate the focused link; clicking will activate the hovered link. This matches up with how Firefox and Chrome handle suggestions in their URL bar, and avoids stray mouse movements changing the focus. Selecting tabs is now done with left/right arrows while any search result is focused. The visibility of results on each search tab is controlled with the "active" class, rather than by setting display: none directly. Note that the old code kept track of highlighted search element when tabbing back and forth. The new code doesn't. Demo at https://hoffman-andrews.com/rust/focus-search-results2/std/?search=fn Fixes #84384 Fixes #79962 Fixes #79872
2021-05-18Improve display for "copy-path" button, making it more discreteGuillaume Gomez-3/+12
2021-05-16Fix invalid input:disabled CSS selectorGuillaume Gomez-1/+1
2021-05-13rustdoc: use focus for search navigationJacob Hoffman-Andrews-21/+25
Rather than keeping track of highlighted element inside the JS, take advantage of `.focus()` and the :focus CSS pseudo-class. This required wrapping each row of results in one big <a> tag (because anchors can be focused, but table rows cannot). That in turn required moving from a table layout to a div layout with float. This makes it so Ctrl+Enter opens links in new tabs, and using the arrow keys to navigate off the bottom of the page scrolls the rest of the page into view. It also simplifies the keyboard event handling. It eliminates the need for click handlers on the search results, and for tracking mouse movements. This changes the UI treatment of mouse hovering. A hovered element now gets a light grey background, but does not change the focused element. It's possible to have two highlighted search results: one that is focused (via keyboard) and one that is hovered (via mouse). Pressing enter will activate the focused link; clicking will activate the hovered link. This matches up with how Firefox and Chrome handle suggestions in their URL bar, and avoids stray mouse movements changing the focus. Selecting tabs is now done with left/right arrows while any search result is focused. The visibility of results on each search tab is controlled with the "active" class, rather than by setting display: none directly. Note that the old code kept track of highlighted search element when tabbing back and forth. The new code doesn't.
2021-05-13Rollup merge of #85175 - GuillaumeGomez:rustdoc-cleanup, r=jshaGuillaume Gomez-1/+0
Rustdoc cleanup Part of https://github.com/rust-lang/rust/issues/83332. The goal of this PR is to remove a few unused things: * The "loading content" things are now unneeded. * Some toggle CSS rules were still there. * Some parts of the JS had a different indent, fixed it. r? `@jsha`
2021-05-12Remove unused CSS rulesGuillaume Gomez-1/+0
2021-05-11Move global click handlers to per-element ones.Jacob Hoffman-Andrews-2/+2
In rustdoc's main.js, we had an onclick handler for the whole document that would dispatch to handlers for various elements. This change attaches the handlers to the elements that trigger them, instead. This simplfies the code and avoids reimplementing the browser's bubbling functionality. As part of this change, change from a class to an id for help button. Move the handlers and associated code for highlighting source lines into source-script.js (and factor out a shared regex).
2021-05-10Fix line number not being clickable on source pagesGuillaume Gomez-1/+1
2021-05-02Migrate trait and impl blocks' toggles intoGuillaume Gomez-1/+2
2021-04-20Auto merge of #83900 - torhovland:issue-83832, r=jyn514bors-1/+2
Add stability tags to ImportItem. Fixes #83832.
2021-04-18Give import items their own CSS class.Tor Hovland-1/+2
2021-04-17Reduce visual weight of attributes.Jacob Hoffman-Andrews-1/+2
2021-04-12Move color to themesManish Goregaokar-1/+3
2021-04-12Improve CSS for "hide contents, not items"Jacob Hoffman-Andrews-1/+1
Introduce a first use of the `<details>` and `<summary>` tags as replacements for the JS-built toggles. I think this has the potential to replace all the JS toggles and generally clean up the JS, CSS, and HTML. Split rendering of attributes into two cases: in the case where they are rendered as descendents of a `<pre>` tag, where they use indent spaces and newlines for formatting, matching their surrounding markup. In the case where they are rendered as descendants of a `<code>` tag, they are rendered as `<div>`. This let me clean up some fragile CSS that was adjusting the margin-left of attributes depending on context. Remove toggles for attributes. With the ALLOWED_ATTRIBUTES filter, it's rare for an item to have more than one attribute, so hiding attributes behind a toggle doesn't save any screen space in the common case. Fix a couple of invocations of `matches!` that didn't compile on my machine. Fix a boolean for the JS `createToggle` call that was causing "Expand description" to show up spuriously on already-expanded descriptions. Add JS for auto-hide settings and hide all / show all. Remove a z-index property and some font color tweaks made unnecessary by the <details> toggles. Add CSS for the <details> toggles.
2021-04-12rustdoc: smartly hide associated items of traits if there are too many of themManish Goregaokar-1/+1
2021-03-31Add a button to copy the "use statement"Guillaume Gomez-2/+3
2021-03-23Slight visual improvements to warning boxes in the docsr00ster91-2/+2
2021-03-15No background for code in portability snippetsSimonas Kazlauskas-4/+1
This better matches the appearance of this kind of snippet in the full item view and is less jarring to read due to repeated foreground-background changes.
2020-12-24Auto merge of #79742 - GuillaumeGomez:move-tooltips-messages-out-of-html, ↵bors-2/+2
r=Nemo157 Move tooltips messages out of html First thing first: nothing in the output has changed. You still have the "i" on the left of code blocks examples when they have `ignore`, `compile_fail`, `should_panic` and `edition`. The behavior also remains the same: when you hover the "i", you have the corresponding message showing up. So now, why this PR then? I realized recently that we were actually generating those messages into the HTML every time whereas all messages are the same (except for the edition ones, I'll come back to it later). So instead of generating more content, I simply moved it inside the CSS thanks to pseudo elements (`::before` and `::after`). The message is now inside `::after` and we use the `::before` to have the small triangle on the left of the message. So now, we have less HTML generated which is seems pretty nice. So now, back to the `edition` change: the message is globally the same, but the "edition" itself can be different (2015 or 2018 currently, I expect 2021 to arrive not too far in the future). So the only difference for it is that I added a new attribute on the tooltip called `edition` which contains this information. Then, the `::after` uses it inside its `content` (you can get the content of an element's attribute by using `attr` and concat different strings by simply having them after the other). Don't hesitate if a part of my explanations isn't clear. r? `@jyn514`
2020-12-12rustdoc light theme: Fix CSS for selected buttonsCamelid-1/+1
The background was dark before, which made the text impossible to read. Now the background is white, which is how selected `div`s are rendered. As a result, the search results tabs now look identical to how they used to look (before #79896).
2020-12-10Make search results tab and help button focusable with keyboardGuillaume Gomez-3/+4
2020-12-05Move tooltips messages to CSS instead of inside HTMLGuillaume Gomez-2/+2
2020-11-24Rename "stability" CSS class to "item-info"Guillaume Gomez-2/+2
2020-10-19Add link to rustdoc book in rustdoc help popupGuillaume Gomez-1/+6
2020-08-11Rollup merge of #75366 - GuillaumeGomez:help-button, r=jyn514Dylan DPC-2/+3
Add help button Part of #75197. Here is a screenshot of the result: ![Screenshot from 2020-08-10 16-53-20](https://user-images.githubusercontent.com/3050060/89796547-14112a00-db2a-11ea-9f25-57b30ab68f9b.png) r? @jyn514
2020-08-11Rollup merge of #75249 - GuillaumeGomez:rust-logo-border, r=ManishearthDylan DPC-2/+2
Only add a border for the rust logo ![Screenshot from 2020-08-07 11-22-51](https://user-images.githubusercontent.com/3050060/89631113-9dadc700-d8a0-11ea-8063-ad40207decaa.png) ![Screenshot from 2020-08-07 11-19-47](https://user-images.githubusercontent.com/3050060/89631114-9e465d80-d8a0-11ea-96ba-1d6926c8e7a9.png) ![Screenshot from 2020-08-07 11-19-41](https://user-images.githubusercontent.com/3050060/89631117-9edef400-d8a0-11ea-9c66-0df3d8c1ac2d.png) I didn't add a border for the light theme though, as I felt it as unnecessary. r? @Manishearth
2020-08-10Add help buttonGuillaume Gomez-2/+3
2020-08-09Rename "Important traits" to "Notable traits"Camelid-1/+1
* Rename it in the UI * Rename the CSS classes
2020-08-07Only add a border for the rust logoGuillaume Gomez-2/+2
2020-07-24Rollup merge of #74504 - lzutao:ayu-border-selected-fn, r=GuillaumeGomezYuki Okushi-0/+1
Add right border bar to Dark and Light theme Demo: Light theme: https://github.com/rust-lang/rust/pull/74504#issuecomment-662491120 Dark theme: https://github.com/rust-lang/rust/pull/74504#issuecomment-662522446 Ayu theme: https://github.com/rust-lang/rust/pull/74504#issuecomment-662625685
2020-07-24Rollup merge of #74361 - GuillaumeGomez:theme-logo, r=ManishearthYuki Okushi-0/+4
Improve doc theme logo display Fixes #74350. The first commit cleans up the whitespaces and converts them to tabs. We should definitely write a tidy check for this (will do it in another PR). Screenshots: ![Screenshot from 2020-07-15 14-08-25](https://user-images.githubusercontent.com/3050060/87543748-8581c800-c6a5-11ea-8417-cbf98ebbfd10.png) ![Screenshot from 2020-07-15 14-11-59](https://user-images.githubusercontent.com/3050060/87543747-84e93180-c6a5-11ea-8cea-976b1470e809.png) ![Screenshot from 2020-07-15 14-12-12](https://user-images.githubusercontent.com/3050060/87543745-84509b00-c6a5-11ea-8324-c3c46ab2d9ef.png) r? @lzutao cc @Cldfire
2020-07-24Add right border bar to Dark and Light themeLzu Tao-0/+1
Ayu has it. Adding similar rule to other themes makes users less surprised and makes GUI more consistent.
2020-07-17Fix tidy issuesGuillaume Gomez-2/+4
2020-07-17Improve logo image display in different themesGuillaume Gomez-0/+4
2020-07-16Rollup merge of #74351 - lzutao:remove-rustc-internal-compiler-warns, ↵Manish Goregaokar-5/+0
r=Mark-Simulacrum Do not render unstable items for rustc doc See the zulip conversion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rustc.20doc.3A.20.22internal.20compiler.20API.22.20warns.20are.20everywhere!/near/203850782 Before: ![image](https://user-images.githubusercontent.com/15225902/87501971-9cff8780-c68a-11ea-93b4-ea53ce18a77b.png) After: ![image](https://user-images.githubusercontent.com/15225902/87501985-a7218600-c68a-11ea-81c0-a6b5b120832c.png) Nothing changes in unstable items of std: Before: ![image](https://user-images.githubusercontent.com/15225902/87502004-b7d1fc00-c68a-11ea-9224-a27a1d2a81d6.png) After: ![image](https://user-images.githubusercontent.com/15225902/87502018-c0c2cd80-c68a-11ea-9773-4c63158025cb.png) Closes #54682
2020-07-16Remove !important on border-color and background-colorManish Goregaokar-2/+2
2020-07-16Make spotlight show on hoverManish Goregaokar-31/+3
This makes the spotlight show on hover instead of click. Clicks can be used to persist it, which is also what's used on mobile.
2020-07-16Revert "Remove "important traits" feature"Manish Goregaokar-0/+33
This reverts commit 1244ced9580b942926afc06815e0691cf3f4a846.
2020-07-15Remove unused CSS rules for internal rustc itemsLzu Tao-5/+0
2020-06-18Added tooltip for should_panic code examples.Jake Degen-0/+16
Previously, compile_fail and ignore code examples displayed a tooltip indicating this in the documentation. This tooltip has now also been added to should_panic examples.
2020-04-07Extend sidebar scrollbar changes to all scrollbarsGuillaume Gomez-4/+15
2020-04-07Improve scrollbar display in rustdocGuillaume Gomez-0/+12