Skip to content

Commit

Permalink
Rollup merge of rust-lang#74368 - GuillaumeGomez:css-tidy-check, r=Ma…
Browse files Browse the repository at this point in the history
…rk-Simulacrum

Add CSS tidy check

r? @Mark-Simulacrum
  • Loading branch information
Manishearth committed Jul 17, 2020
2 parents 3029f0d + 63ffa13 commit c4b0119
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 64 deletions.
1 change: 1 addition & 0 deletions src/librustdoc/html/static/normalize.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
}

* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

/* This part handles the "default" theme being used depending on the system one. */
Expand Down Expand Up @@ -91,7 +91,8 @@ h2 {
h3 {
font-size: 1.3em;
}
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important),
h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
font-weight: 500;
margin: 20px 0 15px 0;
padding-bottom: 6px;
Expand All @@ -103,7 +104,8 @@ h1.fqn {
h1.fqn > .in-band > a:hover {
text-decoration: underline;
}
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
border-bottom: 1px solid;
}
h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
Expand Down
108 changes: 57 additions & 51 deletions src/librustdoc/html/static/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ body {
color: #c5c5c5;
}

h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
h4:not(.method):not(.type):not(.tymethod) {
color: white;
}
h1.fqn {
Expand Down Expand Up @@ -41,13 +42,13 @@ h3 > code, h4 > code, h5 > code {
color: #e6e1cf;
}
pre > code {
color: #e6e1cf;
color: #e6e1cf;
}
span code {
color: #e6e1cf;
color: #e6e1cf;
}
.docblock a > code {
color: #39AFD7 !important;
color: #39AFD7 !important;
}
.docblock code, .docblock-short code {
background-color: #191f26;
Expand Down Expand Up @@ -100,11 +101,11 @@ pre {
}

.sidebar-elems .location {
color: #ff7733;
color: #ff7733;
}

.sidebar-elems .location a {
color: #fff;
color: #fff;
}

.sidebar .version {
Expand All @@ -123,9 +124,9 @@ pre {

.line-numbers span { color: #5c6773ab; }
.line-numbers .line-highlighted {
background-color: rgba(255, 236, 164, 0.06) !important;
padding-right: 4px;
border-right: 1px solid #ffb44c;
background-color: rgba(255, 236, 164, 0.06) !important;
padding-right: 4px;
border-right: 1px solid #ffb44c;
}

.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
Expand Down Expand Up @@ -168,31 +169,31 @@ pre {
.content span.keyword, .content a.keyword { color: #de5249; }

.content span.externcrate, .content span.mod, .content a.mod {
color: #acccf9;
color: #acccf9;
}
.content span.struct, .content a.struct {
color: #ffa0a5;
color: #ffa0a5;
}
.content span.enum, .content a.enum {
color: #99e0c9;
color: #99e0c9;
}
.content span.trait, .content a.trait {
color: #39AFD7;
color: #39AFD7;
}
.content span.type, .content a.type {
color: #cfbcf5;
color: #cfbcf5;
}
.content span.fn, .content a.fn, .content span.method,
.content a.method, .content span.tymethod,
.content a.tymethod, .content .fnname {
color: #fdd687;
color: #fdd687;
}
.content span.attr, .content a.attr, .content span.derive,
.content a.derive, .content span.macro, .content a.macro {
color: #a37acc;
color: #a37acc;
}

pre.rust .comment, pre.rust .doccomment {
pre.rust .comment, pre.rust .doccomment {
color: #788797;
font-style: italic;
}
Expand Down Expand Up @@ -229,16 +230,16 @@ a {
}

.search-input {
color: #ffffff;
background-color: #141920;
box-shadow: none;
transition: box-shadow 150ms ease-in-out;
border-radius: 4px;
margin-left: 8px;
color: #ffffff;
background-color: #141920;
box-shadow: none;
transition: box-shadow 150ms ease-in-out;
border-radius: 4px;
margin-left: 8px;
}

#crate-search+.search-input:focus {
box-shadow: 0px 6px 20px 0px black;
box-shadow: 0px 6px 20px 0px black;
}

.search-focus:disabled {
Expand All @@ -252,7 +253,7 @@ a {
.stab.unstable,
.stab.deprecated,
.stab.portability {
color: #c5c5c5;
color: #c5c5c5;
background: #314559 !important;
border-style: none !important;
border-radius: 4px;
Expand All @@ -265,10 +266,10 @@ a {
}

#help > div {
background: #14191f;
box-shadow: 0px 6px 20px 0px black;
border: none;
border-radius: 4px;
background: #14191f;
box-shadow: 0px 6px 20px 0px black;
border: none;
border-radius: 4px;
}

.since {
Expand All @@ -291,14 +292,14 @@ pre.rust .question-mark {
color: #ff9011;
}
pre.rust .self {
color: #36a3d9;
font-style: italic;
color: #36a3d9;
font-style: italic;
}
pre.rust .attribute {
color: #e6e1cf;
color: #e6e1cf;
}
pre.rust .attribute .ident, pre.rust .attribute .op {
color: #e6e1cf;
color: #e6e1cf;
}

.example-wrap > pre.line-number {
Expand All @@ -307,15 +308,15 @@ pre.rust .attribute .ident, pre.rust .attribute .op {
}

a.test-arrow {
font-size: 100%;
color: #788797;
border-radius: 4px;
background-color: rgba(255, 255, 255, 0);
font-size: 100%;
color: #788797;
border-radius: 4px;
background-color: rgba(255, 255, 255, 0);
}

a.test-arrow:hover {
background-color: rgba(242, 151, 24, 0.05);
color: #ffb44c;
background-color: rgba(242, 151, 24, 0.05);
color: #ffb44c;
}

.toggle-label {
Expand Down Expand Up @@ -380,9 +381,9 @@ pre.ignore:hover, .information:hover + pre.ignore {
}

.tooltip .tooltiptext {
background-color: #314559;
color: #c5c5c5;
border: 1px solid #5c6773;
background-color: #314559;
color: #c5c5c5;
border: 1px solid #5c6773;
}

.tooltip .tooltiptext::after {
Expand All @@ -395,7 +396,7 @@ pre.ignore:hover, .information:hover + pre.ignore {
}

#titles > div.selected {
background-color: #141920 !important;
background-color: #141920 !important;
border-bottom: 1px solid #ffb44c !important;
border-top: none;
}
Expand All @@ -406,7 +407,7 @@ pre.ignore:hover, .information:hover + pre.ignore {
}

#titles > div:hover {
border-bottom: 1px solid rgba(242, 151, 24, 0.3);
border-bottom: 1px solid rgba(242, 151, 24, 0.3);
}

#titles > div > div.count {
Expand All @@ -416,12 +417,13 @@ pre.ignore:hover, .information:hover + pre.ignore {
/* rules that this theme does not need to set, here to satisfy the rule checker */
/* note that a lot of these are partially set in some way (meaning they are set
individually rather than as a group) */
/* TODO: these rules should be at the bottom of the file but currently must be
/* FIXME: these rules should be at the bottom of the file but currently must be
above the `@media (max-width: 700px)` rules due to a bug in the css checker */
/* see https://github.com/rust-lang/rust/pull/71237#issuecomment-618170143 */
.content .highlighted.mod, .content .highlighted.externcrate {}
.search-input:focus {}
.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro {}
.content span.attr,.content a.attr,.block a.current.attr,.content span.derive,.content a.derive,
.block a.current.derive,.content span.macro,.content a.macro,.block a.current.macro {}
.content .highlighted.trait {}
.content span.struct,.content a.struct,.block a.current.struct {}
#titles>div:hover,#titles>div.selected {}
Expand All @@ -436,16 +438,20 @@ pre.rust .lifetime {}
.content .highlighted.fn,.content .highlighted.method,.content .highlighted.tymethod {}
h2,h3:not(.impl):not(.method):not(.type):not(.tymethod),h4:not(.method):not(.type):not(.tymethod) {}
.content span.enum,.content a.enum,.block a.current.enum {}
.content span.constant,.content a.constant,.block a.current.constant,.content span.static,.content a.static,.block a.current.static {}
.content span.constant,.content a.constant,.block a.current.constant,.content span.static,
.content a.static,.block a.current.static {}
.content span.keyword,.content a.keyword,.block a.current.keyword {}
pre.rust .comment {}
.content .highlighted.enum {}
.content .highlighted.struct {}
.content .highlighted.keyword {}
.content span.traitalias,.content a.traitalias,.block a.current.traitalias {}
.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,.content .fnname {}
.content span.fn,.content a.fn,.block a.current.fn,.content span.method,.content a.method,
.block a.current.method,.content span.tymethod,.content a.tymethod,.block a.current.tymethod,
.content .fnname {}
pre.rust .kw {}
pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,pre.rust .attribute .ident {}
pre.rust .self,pre.rust .bool-val,pre.rust .prelude-val,pre.rust .attribute,
pre.rust .attribute .ident {}
.content span.foreigntype,.content a.foreigntype,.block a.current.foreigntype {}
pre.rust .doccomment {}
.stab.deprecated {}
Expand Down Expand Up @@ -486,11 +492,11 @@ kbd {

#theme-picker, #settings-menu {
border-color: #5c6773;
background-color: #0f1419;
background-color: #0f1419;
}

#theme-picker > img, #settings-menu > img {
filter: invert(100);
filter: invert(100);
}

#theme-picker:hover, #theme-picker:focus,
Expand Down
6 changes: 4 additions & 2 deletions src/librustdoc/html/static/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ body {
color: #ddd;
}

h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
h4:not(.method):not(.type):not(.tymethod) {
color: #ddd;
}
h1.fqn {
border-bottom-color: #d2d2d2;
}
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
h4:not(.method):not(.type):not(.tymethod) {
border-bottom-color: #d2d2d2;
}

Expand Down
6 changes: 4 additions & 2 deletions src/librustdoc/html/static/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ body {
color: black;
}

h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
h4:not(.method):not(.type):not(.tymethod) {
color: black;
}
h1.fqn {
border-bottom-color: #D5D5D5;
}
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod),
h4:not(.method):not(.type):not(.tymethod) {
border-bottom-color: #DDDDDD;
}

Expand Down
Loading

0 comments on commit c4b0119

Please sign in to comment.