提交 6409f0d5 编写于 作者: J Jacob Hoffman-Andrews

Make Run button visible on hover

This slightly reduces the noisiness of doc pages, making them easier to
read.
上级 34dc0d0f
...@@ -1117,6 +1117,7 @@ pre.rust .question-mark { ...@@ -1117,6 +1117,7 @@ pre.rust .question-mark {
a.test-arrow { a.test-arrow {
display: inline-block; display: inline-block;
visibility: hidden;
position: absolute; position: absolute;
padding: 5px 10px 5px 10px; padding: 5px 10px 5px 10px;
border-radius: 5px; border-radius: 5px;
...@@ -1125,10 +1126,12 @@ a.test-arrow { ...@@ -1125,10 +1126,12 @@ a.test-arrow {
right: 5px; right: 5px;
z-index: 1; z-index: 1;
} }
.example-wrap:hover .test-arrow {
visibility: visible;
}
a.test-arrow:hover{ a.test-arrow:hover{
text-decoration: none; text-decoration: none;
} }
.section-header:hover a:before { .section-header:hover a:before {
position: absolute; position: absolute;
left: -25px; left: -25px;
......
// Example code blocks sometimes have a "Run" button to run them on the
// Playground. That button is hidden until the user hovers over the code block.
// This test checks that it is hidden, and that it shows on hover.
goto: file://|DOC_PATH|/test_docs/fn.foo.html
assert-css: (".test-arrow", {"visibility": "hidden"})
move-cursor-to: ".example-wrap"
assert-css: (".test-arrow", {"visibility": "visible"})
//! The point of this crate is to be able to have enough different "kinds" of //! The point of this crate is to be able to have enough different "kinds" of
//! documentation generated so we can test each different features. //! documentation generated so we can test each different features.
#![doc(html_playground_url="https://play.rust-lang.org/")]
#![crate_name = "test_docs"] #![crate_name = "test_docs"]
#![feature(rustdoc_internals)] #![feature(rustdoc_internals)]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册