about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-06 13:57:11 +0000
committerbors <bors@rust-lang.org>2015-02-06 13:57:11 +0000
commit0b56e9b1cb2fc00d7d9bc044e2a78b8fb12f2f1b (patch)
tree9e6117de61fb860f879d93ba7928e729520cf825 /src
parentf3573aa834627e52583a9895a8bac6206c56eeef (diff)
parenta40df9ddb9497da0da8c4e72ef6ea53ec72d2e13 (diff)
downloadrust-0b56e9b1cb2fc00d7d9bc044e2a78b8fb12f2f1b.tar.gz
rust-0b56e9b1cb2fc00d7d9bc044e2a78b8fb12f2f1b.zip
Auto merge of #21962 - vrinek:printable-book, r=steveklabnik
Tested on:

* Safari on OSX
* Firefox on OSX
Diffstat (limited to 'src')
-rw-r--r--src/doc/trpl/rust-book.css59
-rw-r--r--src/rustbook/css.rs88
2 files changed, 47 insertions, 100 deletions
diff --git a/src/doc/trpl/rust-book.css b/src/doc/trpl/rust-book.css
deleted file mode 100644
index 3d08de40f55..00000000000
--- a/src/doc/trpl/rust-book.css
+++ /dev/null
@@ -1,59 +0,0 @@
-
-@import url("//static.rust-lang.org/doc/master/rust.css");
-
-body {
-    max-width:none;
-}
-
-#toc {
-    position: absolute;
-    left: 0px;
-    top: 0px;
-    bottom: 0px;
-    width: 250px;
-    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;
-    box-sizing: border-box;
-}
-
-#page-wrapper {
-    position: absolute;
-    overflow-y: auto;
-    left: 260px;
-    right: 0px;
-    top: 0px;
-    bottom: 0px;
-    box-sizing: border-box;
-    background: none repeat scroll 0% 0% #FFF;
-}
-
-#page {
-    margin-left: auto;
-    margin-right:auto;
-    width: 750px;
-}
-
-.chapter {
-    list-style: none outside none;
-    padding-left: 0px;
-    line-height: 30px;
-}
-
-.section {
-    list-style: none outside none;
-    padding-left: 20px;
-    line-height: 30px;
-}
-
-.section li {
-    text-overflow: ellipsis;
-    overflow: hidden;
-    white-space: nowrap;
-}
-
-.chapter li a {
-    color: #000000;
-}
diff --git a/src/rustbook/css.rs b/src/rustbook/css.rs
index 8b933fdd6dd..a5192eefd57 100644
--- a/src/rustbook/css.rs
+++ b/src/rustbook/css.rs
@@ -17,31 +17,55 @@ body {
     max-width:none;
 }
 
-#toc {
-    position: absolute;
-    left: 0px;
-    top: 0px;
-    bottom: 0px;
-    width: 250px;
-    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;
-    box-sizing: border-box;
-    -webkit-overflow-scrolling: touch;
+@media only screen {
+    #toc {
+        position: absolute;
+        left: 0px;
+        top: 0px;
+        bottom: 0px;
+        width: 250px;
+        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;
+        box-sizing: border-box;
+        -webkit-overflow-scrolling: touch;
+    }
+
+    #page-wrapper {
+        position: absolute;
+        overflow-y: auto;
+        left: 260px;
+        right: 0px;
+        top: 0px;
+        bottom: 0px;
+        box-sizing: border-box;
+        background: none repeat scroll 0% 0% #FFF;
+        -webkit-overflow-scrolling: touch;
+    }
 }
 
-#page-wrapper {
-    position: absolute;
-    overflow-y: auto;
-    left: 260px;
-    right: 0px;
-    top: 0px;
-    bottom: 0px;
-    box-sizing: border-box;
-    background: none repeat scroll 0% 0% #FFF;
-    -webkit-overflow-scrolling: touch;
+@media only print {
+    #toc, #nav {
+        display: none;
+    }
+}
+
+@media only screen and (max-width: 1060px) {
+    #toc {
+        width: 100%;
+        margin-right: 0;
+        top: 40px;
+    }
+    #page-wrapper {
+        top: 40px;
+        left: 15px;
+        padding-right: 15px;
+    }
+    .mobile-hidden {
+        display: none;
+    }
 }
 
 #page {
@@ -73,23 +97,6 @@ body {
     color: #000000;
 }
 
-@media only screen and (max-width: 1060px) {
-    #toc {
-        width: 100%;
-        margin-right: 0;
-        top: 40px;
-    }
-    #page-wrapper {
-        top: 40px;
-        left: 15px;
-        padding-right: 15px;
-    }
-    .mobile-hidden {
-        display: none;
-    }
-}
-
-
 #toggle-nav {
     height: 20px;
     width:  30px;
@@ -133,5 +140,4 @@ body {
 .right {
     float: right;
 }
-
 "#;