rust/src
bors 6999ff33c9 Auto merge of #77809 - nasso:master, r=jyn514,guillaumegomez
Add settings to rustdoc to use the system theme

This PR adds new settings to `rustdoc` to use the operating system color scheme.

![click](https://user-images.githubusercontent.com/11479594/95668052-bf604e80-0b6e-11eb-8a17-473aaae510c9.gif)

`rustdoc` actually had [basic support for this](b1af43bc63/src/librustdoc/html/static/storage.js (L121)), but the setting wasn't visible and couldn't be set back once the theme was explicitly set by the user. It also didn't update if the operating system theme preference changed while viewing a page.

I'm using [this method](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Testing_media_queries#Receiving_query_notifications) to query and listen to changes to the `(prefers-color-scheme: dark)` media query. I kept the old method (based on `getComputedStyle`) as a fallback in case the user-agent doesn't support `window.matchMedia` (so like... [pretty much nobody](https://caniuse.com/?search=matchMedia)).

Since there's now more than one official ""dark"" theme in `rustdoc` (and also to support custom/third-party themes), the preferred dark and light themes can be configured in the settings page (the defaults are just "dark" and "light").

This is also my very first "proper" PR to Rust! Please let me know if I did anything wrong :).
2020-10-16 09:58:45 +00:00
..
bootstrap Auto merge of #77756 - alarsyo:setup-llvm-detect, r=jyn514 2020-10-15 02:10:11 +00:00
build_helper
ci Update Xcode beta version to allow aarch64-apple-darwin to compile again 2020-10-14 13:51:28 -04:00
doc Rollup merge of #77951 - ehuss:update-books, r=ehuss 2020-10-15 07:32:40 +09:00
etc Rollup merge of #77788 - ssomers:btree_cleanup_gdb, r=Mark-Simulacrum 2020-10-14 02:30:36 +02:00
librustdoc Auto merge of #77809 - nasso:master, r=jyn514,guillaumegomez 2020-10-16 09:58:45 +00:00
llvm-project@3c5d47c81d Rebase LLVM onto 11.0.0 final 2020-10-14 12:13:20 -07:00
test Auto merge of #77947 - tmiasko:promoted-scope, r=oli-obk 2020-10-16 02:27:49 +00:00
tools Rollup merge of #77493 - hosseind88:ICEs_should_always_print_the_top_of_the_query_stack, r=oli-obk 2020-10-16 02:10:09 +02:00
README.md
stage0.txt
version

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.