Small fixes on code blocks in rustdoc
This commit is contained in:
parent
653da4fd00
commit
0edc9e8395
2 changed files with 9 additions and 4 deletions
|
@ -2262,17 +2262,17 @@
|
||||||
onEach(document.getElementsByClassName('rust-example-rendered'), function(e) {
|
onEach(document.getElementsByClassName('rust-example-rendered'), function(e) {
|
||||||
if (hasClass(e, 'compile_fail')) {
|
if (hasClass(e, 'compile_fail')) {
|
||||||
e.addEventListener("mouseover", function(event) {
|
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.addEventListener("mouseout", function(event) {
|
||||||
e.previousElementSibling.childNodes[0].style.color = '';
|
this.parentElement.previousElementSibling.childNodes[0].style.color = '';
|
||||||
});
|
});
|
||||||
} else if (hasClass(e, 'ignore')) {
|
} else if (hasClass(e, 'ignore')) {
|
||||||
e.addEventListener("mouseover", function(event) {
|
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.addEventListener("mouseout", function(event) {
|
||||||
e.previousElementSibling.childNodes[0].style.color = '';
|
this.parentElement.previousElementSibling.childNodes[0].style.color = '';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
lineNumbersFunc(e);
|
lineNumbersFunc(e);
|
||||||
|
|
|
@ -284,6 +284,7 @@ nav.sub {
|
||||||
|
|
||||||
body:not(.source) .example-wrap {
|
body:not(.source) .example-wrap {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.example-wrap {
|
.example-wrap {
|
||||||
|
@ -303,6 +304,10 @@ body:not(.source) .example-wrap > pre.rust {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body:not(.source) .example-wrap > pre {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
#search {
|
#search {
|
||||||
margin-left: 230px;
|
margin-left: 230px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue