about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathieu David <mathieudavid@mathieudavid.org>2015-06-11 12:48:10 +0200
committerMathieu David <mathieudavid@mathieudavid.org>2015-06-24 22:57:49 +0200
commit0d41764d99bf5507d17105fd2f4f7a30c2c7e7a1 (patch)
treecbe505618a6f37dfc888c899af7b3fb5d9ec4d07
parente2c273f1bb3a7f3d11097533ff59460ef8a9a5c6 (diff)
downloadrust-0d41764d99bf5507d17105fd2f4f7a30c2c7e7a1.tar.gz
rust-0d41764d99bf5507d17105fd2f4f7a30c2c7e7a1.zip
Some love for the rustbook, added Open Sans font, made the sidebar more beautiful with more space and colors, added some style to the code blocks
-rw-r--r--src/rustbook/build.rs1
-rw-r--r--src/rustbook/css.rs41
2 files changed, 34 insertions, 8 deletions
diff --git a/src/rustbook/build.rs b/src/rustbook/build.rs
index a7a6ed3bfe7..dc97d1e2434 100644
--- a/src/rustbook/build.rs
+++ b/src/rustbook/build.rs
@@ -145,6 +145,7 @@ fn render(book: &Book, tgt: &Path) -> CliResult<()> {
             format!("--html-after-content={}", postlude.display()),
             format!("--markdown-playground-url=http://play.rust-lang.org"),
             format!("--markdown-css={}", item.path_to_root.join("rust-book.css").display()),
+            format!("--markdown-css=http://fonts.googleapis.com/css?family&#61;Open+Sans:400italic,700italic,400,700"),
             "--markdown-no-toc".to_string(),
         ];
         let output_result = rustdoc::main_args(rustdoc_args);
diff --git a/src/rustbook/css.rs b/src/rustbook/css.rs
index aae5f21a73d..33517e7cf64 100644
--- a/src/rustbook/css.rs
+++ b/src/rustbook/css.rs
@@ -15,6 +15,15 @@ pub static STYLE: &'static str = r#"
 
 body {
     max-width:none;
+    font: 16px/1.4 'Open Sans', 'Source Serif Pro', Georgia, Times, 'Times New Roman', serif;
+    line-height: 1.6;
+    color: #333;
+}
+
+h1, h2, h3, h4, h5, h6 {
+    font-family: 'Open Sans', 'Fira Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
+    font-weight: bold;
+    color: #333;
 }
 
 @media only screen {
@@ -23,20 +32,21 @@ body {
         left: 0px;
         top: 0px;
         bottom: 0px;
-        width: 250px;
+        width: 300px;
         overflow-y: auto;
         border-right: 1px solid rgba(0, 0, 0, 0.07);
         padding: 10px 10px;
-        font-size: 16px;
-        background: none repeat scroll 0% 0% #FFF;
+        font-size: 14px;
         box-sizing: border-box;
         -webkit-overflow-scrolling: touch;
+        background-color: #fafafa;
+        color: #364149;
     }
 
     #page-wrapper {
         position: absolute;
         overflow-y: auto;
-        left: 260px;
+        left: 310px;
         right: 0px;
         top: 0px;
         bottom: 0px;
@@ -84,7 +94,7 @@ body {
 .section {
     list-style: none outside none;
     padding-left: 20px;
-    line-height: 30px;
+    line-height: 40px;
 }
 
 .section li {
@@ -94,12 +104,17 @@ body {
 }
 
 .chapter li a {
-    color: #000000;
+    color: #333;
+    padding: 5px 0;
 }
 
 .chapter li a.active {
-    text-decoration: underline;
-    font-weight: bold;
+    color: #008cff;
+}
+
+.chapter li a:hover {
+    color: #008cff;
+    text-decoration: none;
 }
 
 #toggle-nav {
@@ -138,6 +153,16 @@ body {
     padding: 0;
 }
 
+pre {
+    padding: 16px;
+    overflow: auto;
+    font-size: 85%;
+    line-height: 1.45;
+    background-color: #f7f7f7;
+    border: 0;
+    border-radius: 3px;
+}
+
 .left {
     float: left;
 }