Skip to content

Commit afe4107

Browse files
Add arrow to the crate select box
1 parent 8062c7a commit afe4107

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

src/librustdoc/html/layout.rs

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
5757
{css_extension}\
5858
{favicon}\
5959
{in_header}\
60+
<style type=\"text/css\">\
61+
#crate-search{{background-image:url(\"{root_path}down-arrow{suffix}.svg\");}}\
62+
</style>\
6063
</head>\
6164
<body class=\"rustdoc {css_class}\">\
6265
<!--[if lte IE 8]>\

src/librustdoc/html/render.rs

+2
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,8 @@ fn write_shared(
793793
static_files::BRUSH_SVG)?;
794794
write(cx.dst.join(&format!("wheel{}.svg", cx.shared.resource_suffix)),
795795
static_files::WHEEL_SVG)?;
796+
write(cx.dst.join(&format!("down-arrow{}.svg", cx.shared.resource_suffix)),
797+
static_files::DOWN_ARROW_SVG)?;
796798
write_minify(cx.dst.join(&format!("light{}.css", cx.shared.resource_suffix)),
797799
static_files::themes::LIGHT,
798800
options.enable_minification)?;
Loading

src/librustdoc/html/static/rustdoc.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ a {
621621
#crate-search {
622622
margin-top: 5px;
623623
padding: 6px;
624-
padding-right: 12px;
624+
padding-right: 19px;
625625
border: 0;
626626
border-right: 0;
627627
border-radius: 4px 0 0 4px;
@@ -633,6 +633,10 @@ a {
633633
/* Removes default arrow from firefox */
634634
text-indent: 0.01px;
635635
text-overflow: "";
636+
background-repeat: no-repeat;
637+
background-color: transparent;
638+
background-size: 16%;
639+
background-position: calc(100% - 1px) 56%;
636640
}
637641
.search-container > .top-button {
638642
position: absolute;

src/librustdoc/html/static_files.rs

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ pub static BRUSH_SVG: &'static [u8] = include_bytes!("static/brush.svg");
4545
/// The file contents of `wheel.svg`, the icon used for the settings button.
4646
pub static WHEEL_SVG: &'static [u8] = include_bytes!("static/wheel.svg");
4747

48+
/// The file contents of `down-arrow.svg`, the icon used for the crate choice combobox.
49+
pub static DOWN_ARROW_SVG: &'static [u8] = include_bytes!("static/down-arrow.svg");
50+
4851
/// The contents of `COPYRIGHT.txt`, the license listing for files distributed with documentation
4952
/// output.
5053
pub static COPYRIGHT: &'static [u8] = include_bytes!("static/COPYRIGHT.txt");

0 commit comments

Comments
 (0)