Rollup merge of #91480 - jsha:fewer-colors, r=GuillaumeGomez
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
This commit is contained in:
commit
72e36d47e8
9 changed files with 82 additions and 70 deletions
|
@ -788,7 +788,7 @@ fn assoc_type(
|
|||
) {
|
||||
write!(
|
||||
w,
|
||||
"{}type <a href=\"{}\" class=\"type\">{}</a>",
|
||||
"{}type <a href=\"{}\" class=\"associatedtype\">{}</a>",
|
||||
extra,
|
||||
naive_assoc_href(it, link, cx),
|
||||
it.name.as_ref().unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue