Skip to content

Commit

Permalink
Small fixes on code blocks in rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 10, 2018
1 parent 653da4f commit 0edc9e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustdoc/html/static/main.js
Expand Up @@ -2262,17 +2262,17 @@
onEach(document.getElementsByClassName('rust-example-rendered'), function(e) {
if (hasClass(e, 'compile_fail')) {
e.addEventListener("mouseover", function(event) {
e.previousElementSibling.childNodes[0].style.color = '#f00';
this.parentElement.previousElementSibling.childNodes[0].style.color = '#f00';
});
e.addEventListener("mouseout", function(event) {
e.previousElementSibling.childNodes[0].style.color = '';
this.parentElement.previousElementSibling.childNodes[0].style.color = '';
});
} else if (hasClass(e, 'ignore')) {
e.addEventListener("mouseover", function(event) {
e.previousElementSibling.childNodes[0].style.color = '#ff9200';
this.parentElement.previousElementSibling.childNodes[0].style.color = '#ff9200';
});
e.addEventListener("mouseout", function(event) {
e.previousElementSibling.childNodes[0].style.color = '';
this.parentElement.previousElementSibling.childNodes[0].style.color = '';
});
}
lineNumbersFunc(e);
Expand Down
5 changes: 5 additions & 0 deletions src/librustdoc/html/static/rustdoc.css
Expand Up @@ -284,6 +284,7 @@ nav.sub {

body:not(.source) .example-wrap {
display: inline-flex;
margin-bottom: 10px;
}

.example-wrap {
Expand All @@ -303,6 +304,10 @@ body:not(.source) .example-wrap > pre.rust {
width: 100%;
}

body:not(.source) .example-wrap > pre {
margin: 0;
}

#search {
margin-left: 230px;
position: relative;
Expand Down

0 comments on commit 0edc9e8

Please sign in to comment.