Skip to content

Commit 11c7bdd

Browse files
committed
Add colors for rustdoc primitives, type, and macros links
1 parent b1e3baa commit 11c7bdd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/librustdoc/html/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ fn primitive_link(f: &mut fmt::Formatter,
378378
Some(&LOCAL_CRATE) => {
379379
let len = CURRENT_LOCATION_KEY.with(|s| s.borrow().len());
380380
let len = if len == 0 {0} else {len - 1};
381-
try!(write!(f, "<a href='{}primitive.{}.html'>",
381+
try!(write!(f, "<a class='primitive' href='{}primitive.{}.html'>",
382382
repeat("../").take(len).collect::<String>(),
383383
prim.to_url_str()));
384384
needs_termination = true;
@@ -398,7 +398,7 @@ fn primitive_link(f: &mut fmt::Formatter,
398398
};
399399
match loc {
400400
Some(root) => {
401-
try!(write!(f, "<a href='{}{}/primitive.{}.html'>",
401+
try!(write!(f, "<a class='primitive' href='{}{}/primitive.{}.html'>",
402402
root,
403403
path.0.first().unwrap(),
404404
prim.to_url_str()));

src/librustdoc/html/static/main.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ a {
415415
.content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
416416
.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
417417
.content span.struct, .content a.struct, .block a.current.struct { color: #e53700; }
418+
.content a.primitive { color: #39a7bf; }
419+
.content a.type { color: #e57300; }
420+
.content a.macro { color: #068000; }
418421
.content span.fn, .content a.fn, .block a.current.fn,
419422
.content span.method, .content a.method, .block a.current.method,
420423
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,

0 commit comments

Comments
 (0)