Rollup merge of #105756 - notriddle:notriddle/example-wrap-tooltip, r=GuillaumeGomez
rustdoc: simplify CSS for codeblock tooltips Instead of making its parts `display: none` and then changing it on hover, just make the pseudo-element itself on hover.
This commit is contained in:
commit
0820bb2826
@ -1118,8 +1118,7 @@ pre.rust .doccomment {
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
.example-wrap .tooltip::after {
|
||||
display: none;
|
||||
.example-wrap .tooltip:hover::after {
|
||||
text-align: center;
|
||||
padding: 5px 3px 3px 3px;
|
||||
border-radius: 6px;
|
||||
@ -1134,35 +1133,30 @@ pre.rust .doccomment {
|
||||
color: var(--tooltip-color);
|
||||
}
|
||||
|
||||
.example-wrap .tooltip::before {
|
||||
.example-wrap .tooltip:hover::before {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 16px;
|
||||
margin-top: -5px;
|
||||
display: none;
|
||||
z-index: 1;
|
||||
border: 5px solid transparent;
|
||||
border-right-color: var(--tooltip-background-color);
|
||||
}
|
||||
|
||||
.example-wrap.ignore .tooltip::after {
|
||||
.example-wrap.ignore .tooltip:hover::after {
|
||||
content: "This example is not tested";
|
||||
}
|
||||
.example-wrap.compile_fail .tooltip::after {
|
||||
.example-wrap.compile_fail .tooltip:hover::after {
|
||||
content: "This example deliberately fails to compile";
|
||||
}
|
||||
.example-wrap.should_panic .tooltip::after {
|
||||
.example-wrap.should_panic .tooltip:hover::after {
|
||||
content: "This example panics";
|
||||
}
|
||||
.example-wrap.edition .tooltip::after {
|
||||
.example-wrap.edition .tooltip:hover::after {
|
||||
content: "This code runs with edition " attr(data-edition);
|
||||
}
|
||||
|
||||
.example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.example-wrap.compile_fail .tooltip,
|
||||
.example-wrap.should_panic .tooltip,
|
||||
.example-wrap.ignore .tooltip {
|
||||
|
@ -20,7 +20,7 @@ define-function: (
|
||||
{"border-left": "2px solid rgba(255, 0, 0, 0.5)"},
|
||||
)),
|
||||
|
||||
("move-cursor-to", ".docblock .example-wrap.compile_fail"),
|
||||
("move-cursor-to", ".docblock .example-wrap.compile_fail .tooltip"),
|
||||
|
||||
("assert-css", (
|
||||
".docblock .example-wrap.compile_fail .tooltip",
|
||||
@ -60,7 +60,7 @@ define-function: (
|
||||
{"border-left": "2px solid rgba(255, 0, 0, 0.5)"},
|
||||
)),
|
||||
|
||||
("move-cursor-to", ".docblock .example-wrap.should_panic"),
|
||||
("move-cursor-to", ".docblock .example-wrap.should_panic .tooltip"),
|
||||
|
||||
("assert-css", (
|
||||
".docblock .example-wrap.should_panic .tooltip",
|
||||
@ -100,7 +100,7 @@ define-function: (
|
||||
{"border-left": "2px solid rgba(255, 142, 0, 0.6)"},
|
||||
)),
|
||||
|
||||
("move-cursor-to", ".docblock .example-wrap.ignore"),
|
||||
("move-cursor-to", ".docblock .example-wrap.ignore .tooltip"),
|
||||
|
||||
("assert-css", (
|
||||
".docblock .example-wrap.ignore .tooltip",
|
||||
|
Loading…
x
Reference in New Issue
Block a user