From 20cc5f9e9a7f48d72552765fd71f69824da781c3 Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Tue, 26 Jul 2022 22:11:21 -0700 Subject: [PATCH] rustdoc: make item-infos dimmer on dark theme #93896 Previously the item-info background colors were too bright for a dark theme, making a bright rectangle that draws the attention. --- src/librustdoc/html/static/css/themes/ayu.css | 13 +------------ src/librustdoc/html/static/css/themes/dark.css | 12 ++++++------ src/librustdoc/html/static/css/themes/light.css | 6 +----- src/test/rustdoc-gui/label-next-to-symbol.goml | 8 ++++---- 4 files changed, 12 insertions(+), 27 deletions(-) diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css index c42cac59bd6fa..b18d12d24e5c1 100644 --- a/src/librustdoc/html/static/css/themes/ayu.css +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -203,20 +203,9 @@ details.rustdoc-toggle > summary::before { color: #000; } -/* Created this empty rule to satisfy the theme checks. */ -.stab.empty-impl {} -.stab.must_implement {} - -.stab.unstable, -.stab.deprecated, -.stab.portability, -.stab.empty-impl, -.stab.must_implement { +.stab { color: #c5c5c5; background: #314559 !important; - border-style: none !important; - border-radius: 4px; - padding: 3px 6px 3px 6px; } .stab.portability > code { diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css index a550eb1c130af..a9d956e227cc1 100644 --- a/src/librustdoc/html/static/css/themes/dark.css +++ b/src/librustdoc/html/static/css/themes/dark.css @@ -173,12 +173,12 @@ details.rustdoc-toggle > summary::before { border-color: #008dfd; } -.stab.empty-impl { background: #FFF5D6; border-color: #FFC600; color: #2f2f2f; } -.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #2f2f2f; } -.stab.deprecated { background: #ffc4c4; border-color: #db7b7b; color: #2f2f2f; } -.stab.must_implement { background: #F3DFFF; border-color: #b07bdb; color: #2f2f2f; } -.stab.portability { background: #F3DFFF; border-color: #b07bdb; color: #2f2f2f; } -.stab.portability > code { background: none; } +.stab { background: #314559; } + +.stab.portability > code { + color: #e6e1cf; + background: none; +} .rightside, .out-of-band { diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css index b751acff152cb..458e5de3f8524 100644 --- a/src/librustdoc/html/static/css/themes/light.css +++ b/src/librustdoc/html/static/css/themes/light.css @@ -160,11 +160,7 @@ details.rustdoc-toggle > summary::before { border-color: #66afe9; } -.stab.empty-impl { background: #FFF5D6; border-color: #FFC600; } -.stab.unstable { background: #FFF5D6; border-color: #FFC600; } -.stab.deprecated { background: #ffc4c4; border-color: #db7b7b; } -.stab.must_implement { background: #F3DFFF; border-color: #b07bdb; } -.stab.portability { background: #F3DFFF; border-color: #b07bdb; } +.stab { background: #FFF5D6; border-color: #FFC600; } .stab.portability > code { background: none; } .rightside, diff --git a/src/test/rustdoc-gui/label-next-to-symbol.goml b/src/test/rustdoc-gui/label-next-to-symbol.goml index ca3994a08b269..f9081189a8600 100644 --- a/src/test/rustdoc-gui/label-next-to-symbol.goml +++ b/src/test/rustdoc-gui/label-next-to-symbol.goml @@ -7,14 +7,14 @@ size: (1080, 600) assert: (".stab.deprecated") assert: (".stab.portability") -// make sure that deprecated and portability are different colours +// make sure that deprecated and portability have the right colors assert-css: ( ".item-table .item-left .stab.deprecated", - { "background-color": "rgb(255, 196, 196)" }, + { "background-color": "rgb(255, 245, 214)" }, ) assert-css: ( ".item-table .item-left .stab.portability", - { "background-color": "rgb(243, 223, 255)" }, + { "background-color": "rgb(255, 245, 214)" }, ) // table like view @@ -51,7 +51,7 @@ assert-css: (".item-right.docblock-short", { "padding-left": "32px" }) compare-elements-position-near: ( "//*[@class='item-left module-item']//a[text()='replaced_function']", ".item-left .stab.deprecated", - {"y": 1}, + {"y": 2}, ) compare-elements-position: ( ".item-left .stab.deprecated",