Skip to content

Commit 18b45d8

Browse files
Migrate kdb colors to CSS variables
1 parent 9cdfe03 commit 18b45d8

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,9 @@ kbd {
14311431
border: solid 1px var(--border-color);
14321432
border-radius: 3px;
14331433
cursor: default;
1434+
color: var(--kbd--color);
1435+
background-color: var(--kbd-background);
1436+
box-shadow: inset 0 -1px 0 var(--kbd-box-shadow-color);
14341437
}
14351438

14361439
ul.all-items > li {

src/librustdoc/html/static/css/themes/ayu.css

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ Original by Dempfi (https://github.com/dempfi/ayu)
6969
--target-border-color: rgba(255, 180, 76, 0.85);
7070
--tooltip-background-color: #314559;
7171
--tooltip-color: #c5c5c5;
72+
--kbd-color: #c5c5c5;
73+
--kbd-background: #314559;
74+
--kbd-box-shadow-color: #5c6773;
7275
--rust-logo-filter: drop-shadow(1px 0 0px #fff)
7376
drop-shadow(0 1px 0 #fff)
7477
drop-shadow(-1px 0 0 #fff)
@@ -195,12 +198,6 @@ pre.rust .kw {}
195198
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, pre.rust .attribute {}
196199
pre.rust .kw-2, pre.rust .prelude-ty {}
197200

198-
kbd {
199-
color: #c5c5c5;
200-
background-color: #314559;
201-
box-shadow: inset 0 -1px 0 #5c6773;
202-
}
203-
204201
#settings-menu > a img {
205202
filter: invert(100);
206203
}

src/librustdoc/html/static/css/themes/dark.css

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
--target-border-color: #bb7410;
6565
--tooltip-background-color: #000;
6666
--tooltip-color: #fff;
67+
--kbd-color: #000;
68+
--kbd-background: #fafbfc;
69+
--kbd-box-shadow-color: #c6cbd1;
6770
--rust-logo-filter: drop-shadow(1px 0 0px #fff)
6871
drop-shadow(0 1px 0 #fff)
6972
drop-shadow(-1px 0 0 #fff)
@@ -100,12 +103,6 @@ details.rustdoc-toggle > summary::before {
100103
color: #888;
101104
}
102105

103-
kbd {
104-
color: #000;
105-
background-color: #fafbfc;
106-
box-shadow: inset 0 -1px 0 #c6cbd1;
107-
}
108-
109106
.search-results .result-name span.alias {
110107
color: #fff;
111108
}

src/librustdoc/html/static/css/themes/light.css

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
--target-border-color: #ad7c37;
6565
--tooltip-background-color: #fdffd3;
6666
--tooltip-color: #fff;
67+
--kbd-color: #000;
68+
--kbd-background: #fafbfc;
69+
--kbd-box-shadow-color: #c6cbd1;
6770
--rust-logo-filter: initial;
6871
/* match border-color; uses https://codepen.io/sosuke/pen/Pjoqqp */
6972
--crate-search-div-filter: invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg)
@@ -93,12 +96,6 @@ body.source .example-wrap pre.rust a {
9396
color: #888;
9497
}
9598

96-
kbd {
97-
color: #000;
98-
background-color: #fafbfc;
99-
box-shadow: inset 0 -1px 0 #c6cbd1;
100-
}
101-
10299
.search-results .result-name span.alias {
103100
color: #000;
104101
}

0 commit comments

Comments
 (0)