Skip to content

Commit e17518f

Browse files
Show everything when noscript is on
1 parent a689887 commit e17518f

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

src/librustdoc/html/layout.rs

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
5454
<link rel=\"stylesheet\" type=\"text/css\" href=\"{root_path}light{suffix}.css\" \
5555
id=\"themeStyle\">\
5656
<script src=\"{root_path}storage{suffix}.js\"></script>\
57+
<noscript><link rel=\"stylesheet\" href=\"{root_path}noscript{suffix}.css\"></noscript>\
5758
{css_extension}\
5859
{favicon}\
5960
{in_header}\

src/librustdoc/html/render.rs

+3
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,9 @@ fn write_shared(
772772
write_minify(cx.dst.join(&format!("settings{}.css", cx.shared.resource_suffix)),
773773
static_files::SETTINGS_CSS,
774774
options.enable_minification)?;
775+
write_minify(cx.dst.join(&format!("noscript{}.css", cx.shared.resource_suffix)),
776+
static_files::NOSCRIPT_CSS,
777+
options.enable_minification)?;
775778

776779
// To avoid "light.css" to be overwritten, we'll first run over the received themes and only
777780
// then we'll run over the "official" styles.
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Copyright 2018 The Rust Project Developers. See the COPYRIGHT
3+
* file at the top-level directory of this distribution and at
4+
* http://rust-lang.org/COPYRIGHT.
5+
*
6+
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
* http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
* <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
* option. This file may not be copied, modified, or distributed
10+
* except according to those terms.
11+
*/
12+
13+
#main > h2 + div, #main > h2 + h3, #main > h3 + div {
14+
display: block;
15+
}
16+
17+
.loading-content {
18+
display: none;
19+
}

src/librustdoc/html/static_files.rs

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ pub static RUSTDOC_CSS: &'static str = include_str!("static/rustdoc.css");
2323
/// The file contents of `settings.css`, responsible for the items on the settings page.
2424
pub static SETTINGS_CSS: &'static str = include_str!("static/settings.css");
2525

26+
/// The file contents of the `noscript.css` file, used in case JS isn't supported or is disabled.
27+
pub static NOSCRIPT_CSS: &'static str = include_str!("static/noscript.css");
28+
2629
/// The file contents of `normalize.css`, included to even out standard elements between browser
2730
/// implementations.
2831
pub static NORMALIZE_CSS: &'static str = include_str!("static/normalize.css");

0 commit comments

Comments
 (0)