From 84615e868b339716a93e7e05f9fb07356c5a9610 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 11 May 2022 11:27:00 +0200 Subject: [PATCH 1/3] Add missing CSS file for settings page --- src/librustdoc/html/render/context.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index a30c533aa48..528180288de 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -596,9 +596,11 @@ fn after_krate(&mut self) -> Result<(), Error> { |buf: &mut Buffer| { write!( buf, - "", - page.static_root_path.unwrap_or(""), - page.resource_suffix + "\ + ", + root_path = page.static_root_path.unwrap_or(""), + suffix = page.resource_suffix, ) }, &self.shared.style_files, From 92482cabaad0a0a63514bdcdcf6e4c8d8dee25e9 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 11 May 2022 11:27:13 +0200 Subject: [PATCH 2/3] Remove unused CSS settings rules --- src/librustdoc/html/static/css/settings.css | 36 --------------------- 1 file changed, 36 deletions(-) diff --git a/src/librustdoc/html/static/css/settings.css b/src/librustdoc/html/static/css/settings.css index 7b337c2bc7a..07588748ad6 100644 --- a/src/librustdoc/html/static/css/settings.css +++ b/src/librustdoc/html/static/css/settings.css @@ -56,38 +56,6 @@ position: absolute; } -.select-wrapper { - float: right; - position: relative; - height: 27px; - min-width: 25%; -} - -.select-wrapper select { - appearance: none; - -moz-appearance: none; - -webkit-appearance: none; - background: none; - border: 2px solid #ccc; - padding-right: 28px; - width: 100%; -} - -.select-wrapper img { - pointer-events: none; - position: absolute; - right: 0; - bottom: 0; - background: #ccc; - height: 100%; - width: 28px; - padding: 0px 4px; -} - -.select-wrapper select option { - color: initial; -} - .slider { position: absolute; cursor: pointer; @@ -96,7 +64,6 @@ right: 0; bottom: 0; background-color: #ccc; - -webkit-transition: .3s; transition: .3s; } @@ -108,7 +75,6 @@ left: 4px; bottom: 4px; background-color: white; - -webkit-transition: .3s; transition: .3s; } @@ -121,8 +87,6 @@ input:focus + .slider { } input:checked + .slider:before { - -webkit-transform: translateX(19px); - -ms-transform: translateX(19px); transform: translateX(19px); } From dd6bb09133f1f97db6a36024bf4e66489fc760c1 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 11 May 2022 11:29:21 +0200 Subject: [PATCH 3/3] Ensure that the settings CSS is loaded on the settings page --- src/test/rustdoc-gui/settings.goml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/rustdoc-gui/settings.goml b/src/test/rustdoc-gui/settings.goml index 6c4611b1cb2..18270264266 100644 --- a/src/test/rustdoc-gui/settings.goml +++ b/src/test/rustdoc-gui/settings.goml @@ -65,3 +65,8 @@ assert: ".setting-line.hidden #theme" // We check their text as well. assert-text: ("#preferred-dark-theme .setting-name", "Preferred dark theme") assert-text: ("#preferred-light-theme .setting-name", "Preferred light theme") + +// Now we go to the settings page to check that the CSS is loaded as expected. +goto: file://|DOC_PATH|/settings.html +wait-for: "#settings" +assert-css: (".setting-line .toggle", {"width": "45px", "margin-right": "20px"})