1
Fork 0

Split rustdoc css to modify it more easily

This commit is contained in:
Guillaume Gomez 2015-12-04 01:54:59 +01:00
parent 68c15be8b5
commit 91cd93d2b1
5 changed files with 144 additions and 65 deletions

View file

@ -47,6 +47,7 @@ r##"<!DOCTYPE html>
<title>{title}</title> <title>{title}</title>
<link rel="stylesheet" type="text/css" href="{root_path}rustdoc.css">
<link rel="stylesheet" type="text/css" href="{root_path}main.css"> <link rel="stylesheet" type="text/css" href="{root_path}main.css">
{favicon} {favicon}

View file

@ -602,8 +602,10 @@ fn write_shared(cx: &Context,
include_bytes!("static/main.js"))); include_bytes!("static/main.js")));
try!(write(cx.dst.join("playpen.js"), try!(write(cx.dst.join("playpen.js"),
include_bytes!("static/playpen.js"))); include_bytes!("static/playpen.js")));
try!(write(cx.dst.join("rustdoc.css"),
include_bytes!("static/rustdoc.css")));
try!(write(cx.dst.join("main.css"), try!(write(cx.dst.join("main.css"),
include_bytes!("static/main.css"))); include_bytes!("static/styles/main.css")));
try!(write(cx.dst.join("normalize.css"), try!(write(cx.dst.join("normalize.css"),
include_bytes!("static/normalize.css"))); include_bytes!("static/normalize.css")));
try!(write(cx.dst.join("FiraSans-Regular.woff"), try!(write(cx.dst.join("FiraSans-Regular.woff"),

View file

@ -32,7 +32,7 @@ included, and carry their own copyright notices and license terms:
Copyright 2005, 2015 jQuery Foundation, Inc. Copyright 2005, 2015 jQuery Foundation, Inc.
Licensed under the MIT license (see LICENSE-MIT.txt). Licensed under the MIT license (see LICENSE-MIT.txt).
* main.css, main.js, and playpen.js: * rustdoc.css, main.js, and playpen.js:
Copyright 2015 The Rust Developers. Copyright 2015 The Rust Developers.
Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or

View file

@ -70,7 +70,6 @@
/* General structure and fonts */ /* General structure and fonts */
body { body {
color: #333;
font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif; font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
margin: 0; margin: 0;
position: relative; position: relative;
@ -91,17 +90,16 @@ h3 {
font-size: 1.3em; font-size: 1.3em;
} }
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;
font-weight: 500; font-weight: 500;
margin: 20px 0 15px 0; margin: 20px 0 15px 0;
padding-bottom: 6px; padding-bottom: 6px;
} }
h1.fqn { h1.fqn {
border-bottom: 1px dashed #D5D5D5; border-bottom: 1px dashed;
margin-top: 0; margin-top: 0;
} }
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: 1px solid #DDDDDD; border-bottom: 1px solid;
} }
h3.impl, h3.method, h4.method, h3.type, h4.type { h3.impl, h3.method, h4.method, h3.type, h4.type {
font-weight: 600; font-weight: 600;
@ -131,7 +129,6 @@ code, pre {
white-space: pre-wrap; white-space: pre-wrap;
} }
.docblock code { .docblock code {
background-color: #F5F5F5;
border-radius: 3px; border-radius: 3px;
padding: 0 0.2em; padding: 0 0.2em;
} }
@ -139,7 +136,6 @@ code, pre {
padding: 0; padding: 0;
} }
pre { pre {
background-color: #F5F5F5;
padding: 14px; padding: 14px;
} }
@ -185,9 +181,7 @@ nav.sub {
.sidebar .location { .sidebar .location {
font-size: 17px; font-size: 17px;
margin: 30px 0 20px 0; margin: 30px 0 20px 0;
background: #e1e1e1;
text-align: center; text-align: center;
color: #333;
} }
.location a:first-child { font-weight: 500; } .location a:first-child { font-weight: 500; }
@ -218,10 +212,6 @@ nav.sub {
transition: border 500ms ease-out; transition: border 500ms ease-out;
} }
.block a:hover {
background: #F5F5F5;
}
.content { .content {
padding: 15px 0; padding: 15px 0;
} }
@ -241,24 +231,7 @@ nav.sub {
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
} }
.line-numbers span { color: #c67e2d; cursor: pointer; } .line-numbers span { cursor: pointer; }
.line-numbers .line-highlighted {
background-color: #f6fdb0 !important;
}
.content .highlighted {
color: #000 !important;
background-color: #ccc;
}
.content .highlighted a, .content .highlighted span { color: #000 !important; }
.content .highlighted.trait { background-color: #fece7e; }
.content .highlighted.mod { background-color: #afc6e4; }
.content .highlighted.enum { background-color: #b4d1b9; }
.content .highlighted.struct { background-color: #e7b1a0; }
.content .highlighted.fn { background-color: #c6afb3; }
.content .highlighted.method { background-color: #c6afb3; }
.content .highlighted.tymethod { background-color: #c6afb3; }
.content .highlighted.type { background-color: #c6afb3; }
.docblock.short p { .docblock.short p {
display: inline; display: inline;
@ -279,7 +252,7 @@ nav.sub {
.docblock.short code { white-space: nowrap; } .docblock.short code { white-space: nowrap; }
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
border-bottom: 1px solid #DDD; border-bottom: 1px solid;
} }
.docblock h1 { font-size: 1.3em; } .docblock h1 { font-size: 1.3em; }
@ -312,7 +285,7 @@ nav.sub {
.content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; } .content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
.docblock table { .docblock table {
border: 1px solid #ddd; border: 1px solid;
margin: .5em 0; margin: .5em 0;
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
@ -320,16 +293,15 @@ nav.sub {
.docblock table td { .docblock table td {
padding: .5em; padding: .5em;
border-top: 1px dashed #ddd; border-top: 1px dashed;
border-bottom: 1px dashed #ddd; border-bottom: 1px dashed;
} }
.docblock table th { .docblock table th {
padding: .5em; padding: .5em;
text-align: left; text-align: left;
border-top: 1px solid #ddd; border-top: 1px solid;
border-bottom: 1px solid #ddd; border-bottom: 1px solid;
} }
.content .item-list { .content .item-list {
@ -368,11 +340,11 @@ nav.sub {
} }
.content .stability code { .content .stability code {
font-size: 90%; font-size: 90%;
} }
nav { nav {
border-bottom: 1px solid #e0e0e0; border-bottom: 1px solid;
padding-bottom: 10px; padding-bottom: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -381,11 +353,11 @@ nav.main {
text-align: center; text-align: center;
} }
nav.main .current { nav.main .current {
border-top: 1px solid #000; border-top: 1px solid;
border-bottom: 1px solid #000; border-bottom: 1px solid;
} }
nav.main .separator { nav.main .separator {
border: 1px solid #000; border: 1px solid;
display: inline-block; display: inline-block;
height: 23px; height: 23px;
margin: 0 20px; margin: 0 20px;
@ -399,29 +371,17 @@ nav.sub, .content {
a { a {
text-decoration: none; text-decoration: none;
color: #000;
background: transparent; background: transparent;
} }
.docblock a, .stability a {
color: #4e8bca;
}
.docblock a:hover, .stability a { .docblock a:hover, .stability a {
text-decoration: underline; text-decoration: underline;
} }
.content span.trait, .content a.trait, .block a.current.trait { color: #8866ff; }
.content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; } .content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
.content span.struct, .content a.struct, .block a.current.struct { color: #e53700; } .content span.struct, .content a.struct, .block a.current.struct { color: #e53700; }
.content a.primitive { color: #39a7bf; }
.content a.type { color: #e57300; } .content a.type { color: #e57300; }
.content a.macro { color: #068000; } .content a.macro { color: #068000; }
.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 { color: #8c6067; }
.block a.current.crate { font-weight: 500; } .block a.current.crate { font-weight: 500; }
.search-input { .search-input {
@ -434,11 +394,9 @@ a {
outline: none; outline: none;
border: none; border: none;
border-radius: 1px; border-radius: 1px;
color: #555;
margin-top: 5px; margin-top: 5px;
padding: 10px 16px; padding: 10px 16px;
font-size: 17px; font-size: 17px;
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
transition: border-color 300ms ease; transition: border-color 300ms ease;
transition: border-radius 300ms ease-in-out; transition: border-radius 300ms ease-in-out;
transition: box-shadow 300ms ease-in-out; transition: box-shadow 300ms ease-in-out;
@ -512,8 +470,6 @@ body.blur > :not(#help) {
padding: 20px; padding: 20px;
} }
em.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
em.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }
em.stab { em.stab {
display: inline-block; display: inline-block;
border-width: 1px; border-width: 1px;
@ -546,7 +502,6 @@ td.summary-column {
padding-right: 0px; padding-right: 0px;
} }
:target { background: #FDFFD3; }
.line-numbers :target { background-color: transparent; } .line-numbers :target { background-color: transparent; }
/* Code highlighting */ /* Code highlighting */
@ -555,8 +510,6 @@ pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
pre.rust .number, pre.rust .string { color: #718C00; } pre.rust .number, pre.rust .string { color: #718C00; }
pre.rust .self, pre.rust .boolval, pre.rust .prelude-val, pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; } pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
pre.rust .comment { color: #8E908C; }
pre.rust .doccomment { color: #4D4D4C; }
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; } pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
pre.rust .lifetime { color: #B76514; } pre.rust .lifetime { color: #B76514; }
@ -565,9 +518,7 @@ pre.rust { position: relative; }
a.test-arrow { a.test-arrow {
display: inline-block; display: inline-block;
position: absolute; position: absolute;
background-color: #4e8bca; background-color: #4e8bca;
color: #f5f5f5;
padding: 5px 10px 5px 10px; padding: 5px 10px 5px 10px;
border-radius: 5px; border-radius: 5px;
font-size: 130%; font-size: 130%;

View file

@ -0,0 +1,125 @@
/**
* Copyright 2015 The Rust Project Developers. See the COPYRIGHT
* file at the top-level directory of this distribution and at
* http://rust-lang.org/COPYRIGHT.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
/* General structure and fonts */
body {
background-color: white;
color: black;
}
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) {
border-bottom-color: #DDDDDD;
}
.docblock code {
background-color: #F5F5F5;
}
pre {
background-color: #F5F5F5;
}
.sidebar .location {
background: #e1e1e1;
color: #333;
}
.block a:hover {
background: #F5F5F5;
}
.line-numbers span { color: #c67e2d; }
.line-numbers .line-highlighted {
background-color: #f6fdb0 !important;
}
:target { background: #FDFFD3; }
.content .highlighted {
color: #000 !important;
background-color: #ccc;
}
.content .highlighted a, .content .highlighted span { color: #000 !important; }
.content .highlighted.trait { background-color: #fece7e; }
.content .highlighted.mod { background-color: #afc6e4; }
.content .highlighted.enum { background-color: #b4d1b9; }
.content .highlighted.struct { background-color: #e7b1a0; }
.content .highlighted.fn { background-color: #c6afb3; }
.content .highlighted.method { background-color: #c6afb3; }
.content .highlighted.tymethod { background-color: #c6afb3; }
.content .highlighted.type { background-color: #c6afb3; }
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
border-bottom-color: #DDD;
}
.docblock table {
border-color: #ddd;
}
.docblock table td {
border-top-color: #ddd;
border-bottom-color: #ddd;
}
.docblock table th {
border-top-color: #ddd;
border-bottom-color: #ddd;
}
.content a.primitive { color: #39a7bf; }
.content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
.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 { color: #8c6067; }
pre.rust .comment { color: #8E908C; }
pre.rust .doccomment { color: #4D4D4C; }
nav {
border-bottom-color: #e0e0e0;
}
nav.main .current {
border-top-color: #000;
border-bottom-color: #000;
}
nav.main .separator {
border-color: 1px solid #000;
}
a {
color: #000;
}
.docblock a, .stability a {
color: #4e8bca;
}
a.test-arrow {
color: #f5f5f5;
}
.content span.trait, .content a.trait, .block a.current.trait { color: #8866ff; }
.search-input {
color: #555;
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
background-color: white;
}
em.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
em.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }