From f3cc957f2e470b30b23ca874d8f0bfc6a7164d7b Mon Sep 17 00:00:00 2001 From: Camelid Date: Sun, 9 Aug 2020 12:09:05 -0700 Subject: [PATCH] Rename "Important traits" to "Notable traits" * Rename it in the UI * Rename the CSS classes --- src/librustdoc/html/render/mod.rs | 4 +-- src/librustdoc/html/static/main.js | 4 +-- src/librustdoc/html/static/rustdoc.css | 28 ++++++++++----------- src/librustdoc/html/static/themes/ayu.css | 2 +- src/librustdoc/html/static/themes/dark.css | 2 +- src/librustdoc/html/static/themes/light.css | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 5fb2d9f6f91..4cbc56333b1 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -3450,7 +3450,7 @@ fn spotlight_decl(decl: &clean::FnDecl) -> String { if impl_.trait_.def_id().map_or(false, |d| c.traits[&d].is_spotlight) { if out.is_empty() { out.push_str(&format!( - "

Important traits for {}

\ + "

Notable traits for {}

\ ", impl_.for_.print() )); @@ -3485,7 +3485,7 @@ fn spotlight_decl(decl: &clean::FnDecl) -> String { if !out.is_empty() { out.insert_str( 0, - "
" + "
" ); out.push_str("
"); diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 082f9cca064..19284018a30 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -2636,9 +2636,9 @@ function defocusSearchBar() { }); }()); - onEachLazy(document.getElementsByClassName("important-traits"), function(e) { + onEachLazy(document.getElementsByClassName("notable-traits"), function(e) { e.onclick = function() { - this.getElementsByClassName('important-traits-tooltiptext')[0] + this.getElementsByClassName('notable-traits-tooltiptext')[0] .classList.toggle("force-tooltip"); }; }); diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index d0312d77a7c..db0e4f4d31d 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -91,7 +91,7 @@ h2 { h3 { font-size: 1.3em; } -h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important), +h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.notable), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) { font-weight: 500; margin: 20px 0 15px 0; @@ -528,7 +528,7 @@ h4 > code, h3 > code, .invisible > code { font-size: 0.8em; } -.content .methods > div:not(.important-traits) { +.content .methods > div:not(.notable-traits) { margin-left: 40px; margin-bottom: 15px; } @@ -1099,17 +1099,17 @@ h3 > .collapse-toggle, h4 > .collapse-toggle { font-size: 20px; } -.important-traits-tooltip { +.notable-traits-tooltip { display: inline-block; cursor: pointer; } -.important-traits:hover .important-traits-tooltiptext, -.important-traits .important-traits-tooltiptext.force-tooltip { +.notable-traits:hover .notable-traits-tooltiptext, +.notable-traits .notable-traits-tooltiptext.force-tooltip { display: inline-block; } -.important-traits .important-traits-tooltiptext { +.notable-traits .notable-traits-tooltiptext { display: none; padding: 5px 3px 3px 3px; border-radius: 6px; @@ -1121,18 +1121,18 @@ h3 > .collapse-toggle, h4 > .collapse-toggle { border: 1px solid; } -.important-traits-tooltip::after { +.notable-traits-tooltip::after { /* The margin on the tooltip does not capture hover events, this extends the area of hover enough so that mouse hover is not lost when moving the mouse to the tooltip */ content: "\00a0\00a0\00a0"; } -.important-traits .important, .important-traits .docblock { +.notable-traits .notable, .notable-traits .docblock { margin: 0; } -.important-traits .docblock code.content{ +.notable-traits .docblock code.content{ margin: 0; padding: 0; font-size: 20px; @@ -1183,13 +1183,13 @@ pre.rust { font-size: 16px; } -.important-traits { +.notable-traits { cursor: pointer; z-index: 2; margin-left: 5px; } -h4 > .important-traits { +h4 > .notable-traits { position: absolute; left: -44px; top: 2px; @@ -1431,7 +1431,7 @@ h4 > .important-traits { z-index: 1; } - h4 > .important-traits { + h4 > .notable-traits { position: absolute; left: -22px; top: 24px; @@ -1522,7 +1522,7 @@ h4 > .important-traits { margin-top: 0; } - .important-traits .important-traits-tooltiptext { + .notable-traits .notable-traits-tooltiptext { left: 0; top: 100%; } @@ -1544,7 +1544,7 @@ h4 > .important-traits { } } -h3.important { +h3.notable { margin: 0; margin-bottom: 13px; font-size: 19px; diff --git a/src/librustdoc/html/static/themes/ayu.css b/src/librustdoc/html/static/themes/ayu.css index f4710f6ae87..60f0d25b219 100644 --- a/src/librustdoc/html/static/themes/ayu.css +++ b/src/librustdoc/html/static/themes/ayu.css @@ -389,7 +389,7 @@ pre.ignore:hover, .information:hover + pre.ignore { border-color: transparent #314559 transparent transparent; } -.important-traits-tooltiptext { +.notable-traits-tooltiptext { background-color: #314559; border-color: #5c6773; } diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/themes/dark.css index b3b586ba362..34c6cbbf4fa 100644 --- a/src/librustdoc/html/static/themes/dark.css +++ b/src/librustdoc/html/static/themes/dark.css @@ -339,7 +339,7 @@ pre.ignore:hover, .information:hover + pre.ignore { border-color: transparent black transparent transparent; } -.important-traits-tooltiptext { +.notable-traits-tooltiptext { background-color: #111; border-color: #777; } diff --git a/src/librustdoc/html/static/themes/light.css b/src/librustdoc/html/static/themes/light.css index b0c5715604b..137aad4ed43 100644 --- a/src/librustdoc/html/static/themes/light.css +++ b/src/librustdoc/html/static/themes/light.css @@ -333,7 +333,7 @@ pre.ignore:hover, .information:hover + pre.ignore { border-color: transparent black transparent transparent; } -.important-traits-tooltiptext { +.notable-traits-tooltiptext { background-color: #eee; border-color: #999; }