Skip to content

Commit

Permalink
Add colors for rustdoc primitives, type, and macros links
Browse files Browse the repository at this point in the history
  • Loading branch information
mdinger committed Oct 24, 2015
1 parent b1e3baa commit 11c7bdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/html/format.rs
Expand Up @@ -378,7 +378,7 @@ fn primitive_link(f: &mut fmt::Formatter,
Some(&LOCAL_CRATE) => {
let len = CURRENT_LOCATION_KEY.with(|s| s.borrow().len());
let len = if len == 0 {0} else {len - 1};
try!(write!(f, "<a href='{}primitive.{}.html'>",
try!(write!(f, "<a class='primitive' href='{}primitive.{}.html'>",
repeat("../").take(len).collect::<String>(),
prim.to_url_str()));
needs_termination = true;
Expand All @@ -398,7 +398,7 @@ fn primitive_link(f: &mut fmt::Formatter,
};
match loc {
Some(root) => {
try!(write!(f, "<a href='{}{}/primitive.{}.html'>",
try!(write!(f, "<a class='primitive' href='{}{}/primitive.{}.html'>",
root,
path.0.first().unwrap(),
prim.to_url_str()));
Expand Down
3 changes: 3 additions & 0 deletions src/librustdoc/html/static/main.css
Expand Up @@ -415,6 +415,9 @@ a {
.content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
.content span.struct, .content a.struct, .block a.current.struct { color: #e53700; }
.content a.primitive { color: #39a7bf; }
.content a.type { color: #e57300; }
.content a.macro { color: #068000; }
.content span.fn, .content a.fn, .block a.current.fn,
.content span.method, .content a.method, .block a.current.method,
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
Expand Down

0 comments on commit 11c7bdd

Please sign in to comment.