Skip to content

Commit

Permalink
rustdoc: refactor and unstyle inline section headers
Browse files Browse the repository at this point in the history
  • Loading branch information
adrientetar committed Apr 26, 2014
1 parent a692e9b commit 5371146
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/html/markdown.rs
Expand Up @@ -209,7 +209,7 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result {
};

// Render the HTML
let text = format!(r#"<h{lvl} id="{id}" class='section-link'><a
let text = format!(r#"<h{lvl} id="{id}" class='section-header'><a
href="\#{id}">{sec_len,plural,=0{}other{{sec} }}{}</a></h{lvl}>"#,
s, lvl = level, id = id,
sec_len = sec.len(), sec = sec);
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/render.rs
Expand Up @@ -1121,7 +1121,7 @@ fn item_module(w: &mut Writer, cx: &Context,
clean::MacroItem(..) => ("macros", "Macros"),
};
try!(write!(w,
"<h2 id='{id}' class='section-link'>\
"<h2 id='{id}' class='section-header'>\
<a href=\"\\#{id}\">{name}</a></h2>\n<table>",
id = short, name = name));
}
Expand Down
17 changes: 9 additions & 8 deletions src/librustdoc/html/static/main.css
Expand Up @@ -388,16 +388,17 @@ pre.rust .doccomment { color: #4D4D4C; }
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
pre.rust .lifetime { color: #B76514; }

h1.section-link:hover a:after,
h2.section-link:hover a:after,
h3.section-link:hover a:after,
h4.section-link:hover a:after,
h5.section-link:hover a:after,
h6.section-link:hover a:after {
content: '\2002\00a7\2002';
.section-header {
border-bottom: none !important;
font-size: 1.1em !important;
margin: 0 !important;
padding: 0 !important;
}
.section-header:hover a:after {
content: '\2002\00a7\2002';
}

/** Media Queries **/
/* Media Queries */

@media (max-width: 700px) {
.sidebar {
Expand Down

0 comments on commit 5371146

Please sign in to comment.