auto merge of #10849 : adridu59/rust/patch-css, r=alexcrichton

rustdoc:
- fix search-bar layout

doc: CSS:
- switch to native pandoc toc depth
- rm some dead code
- clamp width to be readable (we're not Wikipedia!)
- don't background-color titles, it's bloating
- make syntax-highlighting colors inline with rust-lang.org
- space indents

@alexcrichton
This commit is contained in:
bors
2013-12-13 14:21:35 -08:00
7 changed files with 164 additions and 198 deletions

View File

@@ -5,8 +5,6 @@
padding-left: 2em; padding-left: 2em;
} }
#influences blockquote p:last-child { #influences blockquote p:last-child {
display: block; color: #999;
line-height: 1.428571429;
color: #999999;
} }
</style> </style>

View File

@@ -13,99 +13,87 @@
/* Global page semantics /* Global page semantics
========================================================================== */ ========================================================================== */
body { body {
background-color: #fff; margin: 0 auto;
margin: 0 auto; padding: 0 15px;
padding: 0 15px; margin-bottom: 4em;
margin-bottom: 4em; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;
font-size: 14px; color: #333;
color: #333; line-height: 1.428571429;
line-height: 1.428571429;
} }
@media (min-width: 768px) { @media (min-width: 768px) {
body { body {
max-width: 750px; max-width: 750px;
} }
}
@media (min-width: 992px) {
body {
max-width: 970px;
}
}
@media (min-width: 1200px) {
body {
max-width: 1170px;
}
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
color: black; color: black;
font-weight: 500; font-weight: 500;
line-height: 1.1; line-height: 1.1;
} }
h1, h2, h3 { h1, h2, h3 {
margin-top: 20px; margin-top: 20px;
margin-bottom: 10px; margin-bottom: 10px;
} }
h4, h5, h6 { h4, h5, h6 {
margin-top: 12px; margin-top: 12px;
margin-bottom: 10px; margin-bottom: 10px;
padding: .2em .8em;
text-decoration: underline;
} }
h1 { h1 {
font-size: 36px; font-size: 36px;
padding: .1em .4em; padding: .1em .4em;
margin: 0.67em 0; margin: 0.67em 0;
background-color: #E9E9E9; border-bottom: 2px solid #ddd;
border-radius: .2em;
} }
h1.title { h1.title {
line-height: 1.5em; line-height: 1.5em;
} }
h2 { h2 {
font-size: 30px; font-size: 30px;
padding: .2em .5em; padding: .2em .5em;
background-color: #E9E9E9; border-bottom: 1px solid #ddd;
border-radius: .3em;
} }
h3 { h3 {
font-size: 24px; font-size: 24px;
padding: .2em .5em; padding: .2em .7em;
background-color: #DDE8FC; border-bottom: 1px solid #DDE8FC;
border-radius: .4em;
} }
h4 { h4 {
font-size: 18px; font-size: 18px;
} }
h5 { h5 {
font-size: 16px; font-size: 16px;
} }
h6 { h6 {
font-size: 14px; font-size: 14px;
} }
p { p {
margin: 0 0 10px; margin: 0 0 10px;
} }
/* Links layout /* Links layout
========================================================================== */ ========================================================================== */
a { a {
text-decoration: none; text-decoration: none;
color: #428BCA; color: #428BCA;
background: transparent; background: transparent;
} }
a:hover, a:focus { a:hover, a:focus {
color: #2A6496; color: #2A6496;
text-decoration: underline; text-decoration: underline;
} }
a:focus { a:focus {
outline: thin dotted #333; outline: thin dotted #333;
outline: 5px auto -webkit-focus-ring-color; outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px; outline-offset: -2px;
} }
a:hover, a:active { a:hover, a:active {
outline: 0; outline: 0;
} }
h1 a:link, h1 a:visited, h2 a:link, h2 a:visited, h1 a:link, h1 a:visited, h2 a:link, h2 a:visited,
@@ -115,193 +103,168 @@ h5 a:link, h5 a:visited {color: black;}
/* Code /* Code
========================================================================== */ ========================================================================== */
pre, code { pre, code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
border-radius: 4px; border-radius: 4px;
} }
pre { pre {
background-color: #F5F5F5; background-color: #F5F5F5;
border: 1px solid #CCC; border: 1px solid #CCC;
border-radius: 0.5em; border-radius: 0.5em;
white-space: pre-wrap; white-space: pre-wrap;
padding: 9.5px; padding: 9.5px;
margin: 10px 0; margin: 10px 0;
font-size: 13px; font-size: 13px;
word-break: break-all; word-break: break-all;
word-wrap: break-word; word-wrap: break-word;
} }
code { code {
padding: 2px 4px; padding: 2px 4px;
font-size: 90%; font-size: 90%;
color: #C7254E; color: #C7254E;
background-color: #F9F2F4; background-color: #F9F2F4;
white-space: nowrap; white-space: nowrap;
} }
pre code { pre code {
padding: 0; padding: 0;
font-size: inherit; font-size: inherit;
color: inherit; color: inherit;
white-space: pre-wrap; white-space: pre-wrap;
background-color: transparent; background-color: transparent;
border-radius: 0; border-radius: 0;
} }
/* Code highlighting */ /* Code highlighting */
.cm-s-default span.cm-keyword {color: #708;} .cm-s-default span.cm-keyword {color: #803C8D;}
.cm-s-default span.cm-atom {color: #219;} .cm-s-default span.cm-atom {color: #219;}
.cm-s-default span.cm-number {color: #164;} .cm-s-default span.cm-number {color: #2AA198;}
.cm-s-default span.cm-def {color: #00f;} .cm-s-default span.cm-def {color: #256EB8;}
.cm-s-default span.cm-variable {color: black;} .cm-s-default span.cm-variable {color: black;}
.cm-s-default span.cm-variable-2 {color: #05a;} .cm-s-default span.cm-variable-2 {color: #817E61;}
.cm-s-default span.cm-variable-3 {color: #085;} .cm-s-default span.cm-variable-3 {color: #085;}
.cm-s-default span.cm-property {color: black;} .cm-s-default span.cm-property {color: black;}
.cm-s-default span.cm-operator {color: black;} .cm-s-default span.cm-operator {color: black;}
.cm-s-default span.cm-comment {color: #a50;} .cm-s-default span.cm-comment {color: #A82323;}
.cm-s-default span.cm-string {color: #a11;} .cm-s-default span.cm-string {color: #866544;}
.cm-s-default span.cm-string-2 {color: #f50;} .cm-s-default span.cm-string-2 {color: #F50;}
.cm-s-default span.cm-meta {color: #555;} .cm-s-default span.cm-meta {color: #555;}
/*.cm-s-default span.cm-error {color: #f00;}*/ /*.cm-s-default span.cm-error {color: #F00;}*/
.cm-s-default span.cm-qualifier {color: #555;} .cm-s-default span.cm-qualifier {color: #555;}
.cm-s-default span.cm-builtin {color: #30a;} .cm-s-default span.cm-builtin {color: #30A;}
.cm-s-default span.cm-bracket {color: #cc7;} .cm-s-default span.cm-bracket {color: #CC7;}
.cm-s-default span.cm-tag {color: #170;} .cm-s-default span.cm-tag {color: #170;}
.cm-s-default span.cm-attribute {color: #00c;} .cm-s-default span.cm-attribute {color: #00C;}
/* The rest /* The rest
========================================================================== */ ========================================================================== */
#versioninfo { #versioninfo {
text-align: center; text-align: center;
margin: 0.5em; margin: 0.5em;
font-size: 1.1em; font-size: 1.1em;
} }
@media (min-width: 768px) { @media (min-width: 768px) {
#versioninfo { #versioninfo {
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;
right: 0px; right: 0px;
} }
.white-sticker { .white-sticker {
background-color: #fff; background-color: #fff;
margin: 2px; margin: 2px;
padding: 0 2px; padding: 0 2px;
border-radius: .3em; border-radius: .3em;
} }
} }
#versioninfo a.hash { #versioninfo a.hash {
color: gray; color: gray;
font-size: 70%; font-size: 70%;
} }
blockquote { blockquote {
color: black; color: black;
border-left: 5px solid #eee; border-left: 5px solid #eee;
margin: 0 0 20px; margin: 0 0 20px;
padding: 10px 20px; padding: 10px 20px;
} }
blockquote p { blockquote p {
font-size: 17px; font-size: 17px;
font-weight: 300; font-weight: 300;
line-height: 1.25; line-height: 1.25;
} }
blockquote p:last-child { blockquote p:last-child {
margin-bottom: 0; margin-bottom: 0;
}
/* Make the table under the tutorial's 'Types' section look nicer */
table {
border-top: 1px solid silver;
border-bottom: 1px solid silver;
padding: 0.8em;
font-size: smaller;
}
/* Also for the benefit of the type table */
td {
padding-right: 1em;
} }
ul, ul,
ol { ol {
margin-top: 0; margin-top: 0;
margin-bottom: 10px; margin-bottom: 10px;
} }
ul ul, ul ul,
ol ul, ol ul,
ul ol, ul ol,
ol ol { ol ol {
margin-bottom: 0; margin-bottom: 0;
} }
dl { dl {
margin-bottom: 20px; margin-bottom: 20px;
} }
dd { dd {
margin-left: 0; margin-left: 0;
} }
#TOC ul { #TOC ul {
list-style-type: none; list-style-type: none;
padding-left: 0px; padding-left: 0px;
}
/* Only display one level of hierarchy in the TOC */
#TOC ul ul {
display: none;
}
/* Adjust list alignment so rustdoc indexes don't align with blockquotes */
div.index ul {
padding-left: 1em;
}
div.section.level3 {
margin-left: 1em;
} }
sub, sub,
sup { sup {
font-size: 75%; font-size: 75%;
line-height: 0; line-height: 0;
position: relative; position: relative;
} }
hr { hr {
margin-top: 20px; margin-top: 20px;
margin-bottom: 20px; margin-bottom: 20px;
border: 0; border: 0;
border-top: 1px solid #eeeeee; border-top: 1px solid #eeeeee;
} }
@media print { @media print {
* { * {
text-shadow: none !important; text-shadow: none !important;
color: #000 !important; color: #000 !important;
background: transparent !important; background: transparent !important;
box-shadow: none !important; box-shadow: none !important;
} }
a, a:visited { a, a:visited {
text-decoration: underline; text-decoration: underline;
} }
a[href]:after { a[href]:after {
content: " (" attr(href) ")"; content: " (" attr(href) ")";
} }
a[href^="javascript:"]:after, a[href^="#"]:after { a[href^="javascript:"]:after, a[href^="#"]:after {
content: ""; content: "";
} }
pre, blockquote { pre, blockquote {
border: 1px solid #999; border: 1px solid #999;
page-break-inside: avoid; page-break-inside: avoid;
} }
@page { @page {
margin: 2cm .5cm; margin: 2cm .5cm;
} }
p, h2, h3 { p, h2, h3 {
orphans: 3; orphans: 3;
widows: 3; widows: 3;
} }
h2, h3 { h2, h3 {
page-break-after: avoid; page-break-after: avoid;
} }
table { table {
border-collapse: collapse !important; border-collapse: collapse !important;
} }
table td, table th { table td, table th {
background-color: #fff !important; background-color: #fff !important;
} }
} }

View File

@@ -319,7 +319,6 @@ r##"foo #"# bar"##; // foo #"# bar
#### Number literals #### Number literals
~~~~ {.ebnf .gram} ~~~~ {.ebnf .gram}
num_lit : nonzero_dec [ dec_digit | '_' ] * num_suffix ? num_lit : nonzero_dec [ dec_digit | '_' ] * num_suffix ?
| '0' [ [ dec_digit | '_' ] * num_suffix ? | '0' [ [ dec_digit | '_' ] * num_suffix ?
| 'b' [ '1' | '0' | '_' ] + int_suffix ? | 'b' [ '1' | '0' | '_' ] + int_suffix ?

View File

@@ -15,8 +15,8 @@
DOCS := DOCS :=
DOCS_L10N := DOCS_L10N :=
BASE_DOC_OPTS := --from=markdown --standalone --toc --number-sections --include-before-body=doc/version_info.html BASE_DOC_OPTS := --from=markdown --standalone --toc --number-sections
HTML_OPTS = $(BASE_DOC_OPTS) --to=html5 --section-divs --css=rust.css --include-in-header=doc/favicon.inc HTML_OPTS = $(BASE_DOC_OPTS) --to=html5 --section-divs --css=rust.css --include-before-body=doc/version_info.html --include-in-header=doc/favicon.inc
TEX_OPTS = $(BASE_DOC_OPTS) --to=latex TEX_OPTS = $(BASE_DOC_OPTS) --to=latex
EPUB_OPTS = $(BASE_DOC_OPTS) --to=epub EPUB_OPTS = $(BASE_DOC_OPTS) --to=epub

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -58,11 +58,13 @@ pub fn render<T: fmt::Default, S: fmt::Default>(
<nav class=\"sub\"> <nav class=\"sub\">
<form class=\"search-form js-only\"> <form class=\"search-form js-only\">
<input class=\"search-input\" name=\"search\"
autocomplete=\"off\"
placeholder=\"Search documentation...\"
type=\"search\" />
<button class=\"do-search\">Search</button> <button class=\"do-search\">Search</button>
<div class=\"search-container\">
<input class=\"search-input\" name=\"search\"
autocomplete=\"off\"
placeholder=\"Search documentation...\"
type=\"search\" />
</div>
</form> </form>
</nav> </nav>

View File

@@ -233,10 +233,14 @@ a {
.content a.fn, .block a.current.fn { color: #8c6067; } .content a.fn, .block a.current.fn { color: #8c6067; }
.content .fnname { color: #8c6067; } .content .fnname { color: #8c6067; }
.search-container {
padding-right: 10px;
overflow: hidden;
}
.search-input { .search-input {
border: 2px solid #e9e9e9; border: 2px solid #e9e9e9;
border-radius: 2px; border-radius: 2px;
width: calc(100% - 66px); width: 100%;
} }
.do-search { .do-search {
float: right; float: right;