Skip to content

Commit

Permalink
Some love for the rustbook, added Open Sans font, made the sidebar mo…
Browse files Browse the repository at this point in the history
…re beautiful with more space and colors, added some style to the code blocks
  • Loading branch information
azerupi committed Jun 24, 2015
1 parent e2c273f commit 0d41764
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/rustbook/build.rs
Expand Up @@ -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);
Expand Down
41 changes: 33 additions & 8 deletions src/rustbook/css.rs
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down Expand Up @@ -84,7 +94,7 @@ body {
.section {
list-style: none outside none;
padding-left: 20px;
line-height: 30px;
line-height: 40px;
}
.section li {
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 0d41764

Please sign in to comment.