Skip to content

Commit 9c6ef4a

Browse files
authoredSep 17, 2022
Rollup merge of #101898 - GuillaumeGomez:rm-unused-css, r=notriddle
Remove some unused CSS rules Since we now have list of items for the ones on the page, we don't need the CSS rules anymore in the sidebar (`.sidebar a`). As for the `.content` ones, they are used to highlight the items in the page (for definitions and others). Surprisingly enough, `method` and `tymethod` are all replaced with `fnname`. I also used this opportunity to remove these rules in `ayu.css`: ```css .stab.unstable {} h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {} ``` In the second commit, I removed the `.block a.current*` CSS rules as they're overridden by `.sidebar a.current*` CSS rules. In the third commit I removed unneeded empty rules (that were there to satisfy the `--check-theme` option). cc ``@jsha`` r? ``@notriddle``
2 parents 8b88370 + 28956d1 commit 9c6ef4a

File tree

3 files changed

+46
-105
lines changed

3 files changed

+46
-105
lines changed
 

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

+9-48
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ pre, .rustdoc.source .example-wrap {
118118
.content span.primitive, .content a.primitive { color: #ffa0a5; }
119119
.content span.traitalias, .content a.traitalias { color: #39AFD7; }
120120
.content span.keyword, .content a.keyword { color: #39AFD7; }
121-
122-
.content span.externcrate, .content span.mod, .content a.mod {
121+
.content span.mod, .content a.mod {
123122
color: #39AFD7;
124123
}
125124
.content span.struct, .content a.struct {
@@ -131,28 +130,17 @@ pre, .rustdoc.source .example-wrap {
131130
.content span.trait, .content a.trait {
132131
color: #39AFD7;
133132
}
134-
.content span.type, .content a.type {
135-
color: #39AFD7;
136-
}
137-
.content span.type,
138-
.content a.type,
139-
.block a.current.type { color: #39AFD7; }
140-
.content span.associatedtype,
141-
.content a.associatedtype,
142-
.block a.current.associatedtype { color: #39AFD7; }
143-
.content span.fn, .content a.fn, .content span.method,
144-
.content a.method, .content span.tymethod,
145-
.content a.tymethod, .content .fnname {
146-
color: #fdd687;
147-
}
133+
.content span.type, .content a.type { color: #39AFD7; }
134+
.content span.associatedtype, .content a.associatedtype { color: #39AFD7; }
135+
.content span.fn, .content a.fn,
136+
.content .fnname { color: #fdd687; }
148137
.content span.attr, .content a.attr, .content span.derive,
149138
.content a.derive, .content span.macro, .content a.macro {
150139
color: #a37acc;
151140
}
152141

153142
.sidebar a { color: #53b1db; }
154143
.sidebar a.current.type { color: #53b1db; }
155-
.sidebar a.current.associatedtype { color: #53b1db; }
156144

157145
pre.rust .comment { color: #788797; }
158146
pre.rust .doccomment { color: #a1ac88; }
@@ -290,34 +278,11 @@ individually rather than as a group) */
290278
/* FIXME: these rules should be at the bottom of the file but currently must be
291279
above the `@media (max-width: 700px)` rules due to a bug in the css checker */
292280
/* see https://github.com/rust-lang/rust/pull/71237#issuecomment-618170143 */
293-
.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,
294-
.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro {}
295-
.content span.struct,.content a.struct,.block a.current.struct {}
296-
#titles>button:hover,#titles>button.selected {}
297-
.content span.typedef,.content a.typedef,.block a.current.typedef {}
298-
.content span.union,.content a.union,.block a.current.union {}
299281
pre.rust .lifetime {}
300-
.stab.unstable {}
301-
h2,
302-
h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {}
303-
.content span.enum,.content a.enum,.block a.current.enum {}
304-
.content span.constant,.content a.constant,.block a.current.constant,.content span.static,
305-
.content a.static, .block a.current.static {}
306-
.content span.keyword,.content a.keyword,.block a.current.keyword {}
307-
.content span.traitalias,.content a.traitalias,.block a.current.traitalias {}
308-
.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,
309-
.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,
310-
.content .fnname {}
311282
pre.rust .kw {}
312-
pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute {}
313-
.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype {}
314-
.stab.deprecated {}
315-
.content a.attr,.content a.derive,.content a.macro {}
316-
.stab.portability {}
317-
.content span.primitive,.content a.primitive,.block a.current.primitive {}
318-
.content span.externcrate,.content span.mod,.content a.mod,.block a.current.mod {}
319-
pre.rust .kw-2,pre.rust .prelude-ty {}
320-
.content span.trait,.content a.trait,.block a.current.trait {}
283+
#titles > button:hover, #titles > button.selected {}
284+
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, pre.rust .attribute {}
285+
pre.rust .kw-2, pre.rust .prelude-ty {}
321286

322287
.search-results a:focus span {}
323288
a.result-trait:focus {}
@@ -353,13 +318,9 @@ a.result-keyword:focus {}
353318
.sidebar a.current.constant
354319
.sidebar a.current.static {}
355320
.sidebar a.current.primitive {}
356-
.sidebar a.current.externcrate
357-
.sidebar a.current.mod {}
358321
.sidebar a.current.trait {}
359322
.sidebar a.current.traitalias {}
360-
.sidebar a.current.fn,
361-
.sidebar a.current.method,
362-
.sidebar a.current.tymethod {}
323+
.sidebar a.current.fn {}
363324
.sidebar a.current.keyword {}
364325

365326
kbd {

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

+19-29
Original file line numberDiff line numberDiff line change
@@ -83,35 +83,29 @@ a.result-keyword:focus { background-color: #884719; }
8383

8484
.content .item-info::before { color: #ccc; }
8585

86-
.content span.enum, .content a.enum, .block a.current.enum { color: #2dbfb8; }
87-
.content span.struct, .content a.struct, .block a.current.struct { color: #2dbfb8; }
88-
.content span.type, .content a.type, .block a.current.type { color: #2dbfb8; }
89-
.content span.associatedtype,
90-
.content a.associatedtype,
91-
.block a.current.associatedtype { color: #D2991D; }
92-
.content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #2dbfb8; }
93-
.content span.attr, .content a.attr, .block a.current.attr,
94-
.content span.derive, .content a.derive, .block a.current.derive,
95-
.content span.macro, .content a.macro, .block a.current.macro { color: #09bd00; }
96-
.content span.union, .content a.union, .block a.current.union { color: #2dbfb8; }
97-
.content span.constant, .content a.constant, .block a.current.constant,
98-
.content span.static, .content a.static, .block a.current.static { color: #D2991D; }
99-
.content span.primitive, .content a.primitive, .block a.current.primitive { color: #2dbfb8; }
100-
.content span.externcrate,
101-
.content span.mod, .content a.mod, .block a.current.mod { color: #D2991D; }
102-
.content span.trait, .content a.trait, .block a.current.trait { color: #b78cf2; }
103-
.content span.traitalias, .content a.traitalias, .block a.current.traitalias { color: #b78cf2; }
104-
.content span.fn, .content a.fn, .block a.current.fn,
105-
.content span.method, .content a.method, .block a.current.method,
106-
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
107-
.content .fnname{ color: #2BAB63; }
108-
.content span.keyword, .content a.keyword, .block a.current.keyword { color: #D2991D; }
86+
.content span.enum, .content a.enum { color: #2dbfb8; }
87+
.content span.struct, .content a.struct { color: #2dbfb8; }
88+
.content span.type, .content a.type { color: #2dbfb8; }
89+
.content span.associatedtype, .content a.associatedtype { color: #D2991D; }
90+
.content span.foreigntype, .content a.foreigntype { color: #2dbfb8; }
91+
.content span.attr, .content a.attr,
92+
.content span.derive, .content a.derive,
93+
.content span.macro, .content a.macro { color: #09bd00; }
94+
.content span.union, .content a.union { color: #2dbfb8; }
95+
.content span.constant, .content a.constant,
96+
.content span.static, .content a.static { color: #D2991D; }
97+
.content span.primitive, .content a.primitive { color: #2dbfb8; }
98+
.content span.mod, .content a.mod { color: #D2991D; }
99+
.content span.trait, .content a.trait { color: #b78cf2; }
100+
.content span.traitalias, .content a.traitalias { color: #b78cf2; }
101+
.content span.fn, .content a.fn,
102+
.content .fnname { color: #2BAB63; }
103+
.content span.keyword, .content a.keyword { color: #D2991D; }
109104

110105
.sidebar a { color: #fdbf35; }
111106
.sidebar a.current.enum { color: #12ece2; }
112107
.sidebar a.current.struct { color: #12ece2; }
113108
.sidebar a.current.type { color: #12ece2; }
114-
.sidebar a.current.associatedtype { color: #fdbf35; }
115109
.sidebar a.current.foreigntype { color: #12ece2; }
116110
.sidebar a.current.attr,
117111
.sidebar a.current.derive,
@@ -120,13 +114,9 @@ a.result-keyword:focus { background-color: #884719; }
120114
.sidebar a.current.constant
121115
.sidebar a.current.static { color: #fdbf35; }
122116
.sidebar a.current.primitive { color: #12ece2; }
123-
.sidebar a.current.externcrate
124-
.sidebar a.current.mod { color: #fdbf35; }
125117
.sidebar a.current.trait { color: #cca7ff; }
126118
.sidebar a.current.traitalias { color: #cca7ff; }
127-
.sidebar a.current.fn,
128-
.sidebar a.current.method,
129-
.sidebar a.current.tymethod { color: #32d479; }
119+
.sidebar a.current.fn { color: #32d479; }
130120
.sidebar a.current.keyword { color: #fdbf35; }
131121

132122
pre.rust .comment { color: #8d8d8b; }

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

+18-28
Original file line numberDiff line numberDiff line change
@@ -82,35 +82,29 @@ a.result-keyword:focus { background-color: #afc6e4; }
8282

8383
.content .item-info::before { color: #ccc; }
8484

85-
.content span.enum, .content a.enum, .block a.current.enum { color: #AD378A; }
86-
.content span.struct, .content a.struct, .block a.current.struct { color: #AD378A; }
87-
.content span.type, .content a.type, .block a.current.type { color: #AD378A; }
88-
.content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #3873AD; }
89-
.content span.associatedtype,
90-
.content a.associatedtype,
91-
.block a.current.associatedtype { color: #3873AD; }
92-
.content span.attr, .content a.attr, .block a.current.attr,
93-
.content span.derive, .content a.derive, .block a.current.derive,
94-
.content span.macro, .content a.macro, .block a.current.macro { color: #068000; }
95-
.content span.union, .content a.union, .block a.current.union { color: #AD378A; }
96-
.content span.constant, .content a.constant, .block a.current.constant,
97-
.content span.static, .content a.static, .block a.current.static { color: #3873AD; }
98-
.content span.primitive, .content a.primitive, .block a.current.primitive { color: #AD378A; }
99-
.content span.externcrate,
100-
.content span.mod, .content a.mod, .block a.current.mod { color: #3873AD; }
101-
.content span.trait, .content a.trait, .block a.current.trait { color: #6E4FC9; }
102-
.content span.traitalias, .content a.traitalias, .block a.current.traitalias { color: #5137AD; }
103-
.content span.fn, .content a.fn, .block a.current.fn,
104-
.content span.method, .content a.method, .block a.current.method,
105-
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
85+
.content span.enum, .content a.enum { color: #AD378A; }
86+
.content span.struct, .content a.struct { color: #AD378A; }
87+
.content span.type, .content a.type { color: #AD378A; }
88+
.content span.associatedtype, .content a.associatedtype { color: #3873AD; }
89+
.content span.foreigntype, .content a.foreigntype { color: #3873AD; }
90+
.content span.attr, .content a.attr,
91+
.content span.derive, .content a.derive,
92+
.content span.macro, .content a.macro { color: #068000; }
93+
.content span.union, .content a.union { color: #AD378A; }
94+
.content span.constant, .content a.constant,
95+
.content span.static, .content a.static { color: #3873AD; }
96+
.content span.primitive, .content a.primitive { color: #AD378A; }
97+
.content span.mod, .content a.mod { color: #3873AD; }
98+
.content span.trait, .content a.trait { color: #6E4FC9; }
99+
.content span.traitalias, .content a.traitalias { color: #5137AD; }
100+
.content span.fn, .content a.fn,
106101
.content .fnname { color: #AD7C37; }
107-
.content span.keyword, .content a.keyword, .block a.current.keyword { color: #3873AD; }
102+
.content span.keyword, .content a.keyword { color: #3873AD; }
108103

109104
.sidebar a { color: #356da4; }
110105
.sidebar a.current.enum { color: #a63283; }
111106
.sidebar a.current.struct { color: #a63283; }
112107
.sidebar a.current.type { color: #a63283; }
113-
.sidebar a.current.associatedtype { color: #356da4; }
114108
.sidebar a.current.foreigntype { color: #356da4; }
115109
.sidebar a.current.attr,
116110
.sidebar a.current.derive,
@@ -119,13 +113,9 @@ a.result-keyword:focus { background-color: #afc6e4; }
119113
.sidebar a.current.constant
120114
.sidebar a.current.static { color: #356da4; }
121115
.sidebar a.current.primitive { color: #a63283; }
122-
.sidebar a.current.externcrate
123-
.sidebar a.current.mod { color: #356da4; }
124116
.sidebar a.current.trait { color: #6849c3; }
125117
.sidebar a.current.traitalias { color: #4b349e; }
126-
.sidebar a.current.fn,
127-
.sidebar a.current.method,
128-
.sidebar a.current.tymethod { color: #a67736; }
118+
.sidebar a.current.fn { color: #a67736; }
129119
.sidebar a.current.keyword { color: #356da4; }
130120

131121
a {

0 commit comments

Comments
 (0)
Please sign in to comment.