Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
{css_extension}\
{favicon}\
{in_header}\
<style type=\"text/css\">\
#crate-search{{background-image:url(\"{root_path}down-arrow{suffix}.svg\");}}\
</style>\
</head>\
<body class=\"rustdoc {css_class}\">\
<!--[if lte IE 8]>\
Expand Down
2 changes: 2 additions & 0 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,8 @@ fn write_shared(
static_files::BRUSH_SVG)?;
write(cx.dst.join(&format!("wheel{}.svg", cx.shared.resource_suffix)),
static_files::WHEEL_SVG)?;
write(cx.dst.join(&format!("down-arrow{}.svg", cx.shared.resource_suffix)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever this gets merged, we'll need to update docs.rs to make it start caching the new SVG. (I'm remembering this detail late for a few other open PRs as well.)

static_files::DOWN_ARROW_SVG)?;
write_minify(cx.dst.join(&format!("light{}.css", cx.shared.resource_suffix)),
static_files::themes::LIGHT,
options.enable_minification)?;
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/html/static/down-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ a {
#crate-search {
margin-top: 5px;
padding: 6px;
padding-right: 12px;
padding-right: 19px;
border: 0;
border-right: 0;
border-radius: 4px 0 0 4px;
Expand All @@ -633,6 +633,10 @@ a {
/* Removes default arrow from firefox */
text-indent: 0.01px;
text-overflow: "";
background-repeat: no-repeat;
background-color: transparent;
background-size: 16%;
background-position: calc(100% - 1px) 56%;
}
.search-container > .top-button {
position: absolute;
Expand Down
3 changes: 3 additions & 0 deletions src/librustdoc/html/static_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ pub static BRUSH_SVG: &'static [u8] = include_bytes!("static/brush.svg");
/// The file contents of `wheel.svg`, the icon used for the settings button.
pub static WHEEL_SVG: &'static [u8] = include_bytes!("static/wheel.svg");

/// The file contents of `down-arrow.svg`, the icon used for the crate choice combobox.
pub static DOWN_ARROW_SVG: &'static [u8] = include_bytes!("static/down-arrow.svg");

/// The contents of `COPYRIGHT.txt`, the license listing for files distributed with documentation
/// output.
pub static COPYRIGHT: &'static [u8] = include_bytes!("static/COPYRIGHT.txt");
Expand Down