Rollup merge of #115812 - GuillaumeGomez:merge-settings-into-rustdoc-css, r=notriddle
Merge settings.css into rustdoc.css There aren't that many CSS rules in `settings.css`, however quite some code is needed around it, making it more costly than useful. I think it's better to merge into `rustdoc.css` to simplify this. r? `@notriddle`
This commit is contained in:
commit
27c6099c79
@ -714,8 +714,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
|
|||||||
You need to enable JavaScript be able to update your settings.\
|
You need to enable JavaScript be able to update your settings.\
|
||||||
</section>\
|
</section>\
|
||||||
</noscript>\
|
</noscript>\
|
||||||
<link rel=\"stylesheet\" \
|
|
||||||
href=\"{static_root_path}{settings_css}\">\
|
|
||||||
<script defer src=\"{static_root_path}{settings_js}\"></script>\
|
<script defer src=\"{static_root_path}{settings_js}\"></script>\
|
||||||
<link rel=\"preload\" href=\"{static_root_path}{theme_light_css}\" \
|
<link rel=\"preload\" href=\"{static_root_path}{theme_light_css}\" \
|
||||||
as=\"style\">\
|
as=\"style\">\
|
||||||
@ -724,7 +722,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
|
|||||||
<link rel=\"preload\" href=\"{static_root_path}{theme_ayu_css}\" \
|
<link rel=\"preload\" href=\"{static_root_path}{theme_ayu_css}\" \
|
||||||
as=\"style\">",
|
as=\"style\">",
|
||||||
static_root_path = page.get_static_root_path(),
|
static_root_path = page.get_static_root_path(),
|
||||||
settings_css = static_files::STATIC_FILES.settings_css,
|
|
||||||
settings_js = static_files::STATIC_FILES.settings_js,
|
settings_js = static_files::STATIC_FILES.settings_js,
|
||||||
theme_light_css = static_files::STATIC_FILES.theme_light_css,
|
theme_light_css = static_files::STATIC_FILES.theme_light_css,
|
||||||
theme_dark_css = static_files::STATIC_FILES.theme_dark_css,
|
theme_dark_css = static_files::STATIC_FILES.theme_dark_css,
|
||||||
|
@ -925,6 +925,70 @@ so that we can apply CSS-filters to change the arrow color in themes */
|
|||||||
top: -5px;
|
top: -5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.setting-line {
|
||||||
|
margin: 1.2em 0.6em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-radio input, .setting-check input {
|
||||||
|
margin-right: 0.3em;
|
||||||
|
height: 1.2rem;
|
||||||
|
width: 1.2rem;
|
||||||
|
border: 2px solid var(--settings-input-border-color);
|
||||||
|
outline: none;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.setting-radio input {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-radio span, .setting-check span {
|
||||||
|
padding-bottom: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-radio {
|
||||||
|
margin-top: 0.1em;
|
||||||
|
margin-bottom: 0.1em;
|
||||||
|
min-width: 3.8em;
|
||||||
|
padding: 0.3em;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.setting-radio + .setting-radio {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-check {
|
||||||
|
margin-right: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-radio input:checked {
|
||||||
|
box-shadow: inset 0 0 0 3px var(--main-background-color);
|
||||||
|
background-color: var(--settings-input-color);
|
||||||
|
}
|
||||||
|
.setting-check input:checked {
|
||||||
|
background-color: var(--settings-input-color);
|
||||||
|
border-width: 1px;
|
||||||
|
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">\
|
||||||
|
<path d="M7,25L17,32L33,12" fill="none" stroke="black" stroke-width="5"/>\
|
||||||
|
<path d="M7,23L17,30L33,10" fill="none" stroke="white" stroke-width="5"/></svg>');
|
||||||
|
}
|
||||||
|
.setting-radio input:focus, .setting-check input:focus {
|
||||||
|
box-shadow: 0 0 1px 1px var(--settings-input-color);
|
||||||
|
}
|
||||||
|
/* In here we combine both `:focus` and `:checked` properties. */
|
||||||
|
.setting-radio input:checked:focus {
|
||||||
|
box-shadow: inset 0 0 0 3px var(--main-background-color),
|
||||||
|
0 0 2px 2px var(--settings-input-color);
|
||||||
|
}
|
||||||
|
.setting-radio input:hover, .setting-check input:hover {
|
||||||
|
border-color: var(--settings-input-color) !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* use larger max-width for help popover, but not for help.html */
|
/* use larger max-width for help popover, but not for help.html */
|
||||||
#help.popover {
|
#help.popover {
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
.setting-line {
|
|
||||||
margin: 1.2em 0.6em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-radio input, .setting-check input {
|
|
||||||
margin-right: 0.3em;
|
|
||||||
height: 1.2rem;
|
|
||||||
width: 1.2rem;
|
|
||||||
border: 2px solid var(--settings-input-border-color);
|
|
||||||
outline: none;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.setting-radio input {
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-radio span, .setting-check span {
|
|
||||||
padding-bottom: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-radio {
|
|
||||||
margin-top: 0.1em;
|
|
||||||
margin-bottom: 0.1em;
|
|
||||||
min-width: 3.8em;
|
|
||||||
padding: 0.3em;
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.setting-radio + .setting-radio {
|
|
||||||
margin-left: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-check {
|
|
||||||
margin-right: 20px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-radio input:checked {
|
|
||||||
box-shadow: inset 0 0 0 3px var(--main-background-color);
|
|
||||||
background-color: var(--settings-input-color);
|
|
||||||
}
|
|
||||||
.setting-check input:checked {
|
|
||||||
background-color: var(--settings-input-color);
|
|
||||||
border-width: 1px;
|
|
||||||
content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40">\
|
|
||||||
<path d="M7,25L17,32L33,12" fill="none" stroke="black" stroke-width="5"/>\
|
|
||||||
<path d="M7,23L17,30L33,10" fill="none" stroke="white" stroke-width="5"/></svg>');
|
|
||||||
}
|
|
||||||
.setting-radio input:focus, .setting-check input:focus {
|
|
||||||
box-shadow: 0 0 1px 1px var(--settings-input-color);
|
|
||||||
}
|
|
||||||
/* In here we combine both `:focus` and `:checked` properties. */
|
|
||||||
.setting-radio input:checked:focus {
|
|
||||||
box-shadow: inset 0 0 0 3px var(--main-background-color),
|
|
||||||
0 0 2px 2px var(--settings-input-color);
|
|
||||||
}
|
|
||||||
.setting-radio input:hover, .setting-check input:hover {
|
|
||||||
border-color: var(--settings-input-color) !important;
|
|
||||||
}
|
|
@ -176,13 +176,6 @@ function browserSupportsHistoryApi() {
|
|||||||
return window.history && typeof window.history.pushState === "function";
|
return window.history && typeof window.history.pushState === "function";
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadCss(cssUrl) {
|
|
||||||
const link = document.createElement("link");
|
|
||||||
link.href = cssUrl;
|
|
||||||
link.rel = "stylesheet";
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(link);
|
|
||||||
}
|
|
||||||
|
|
||||||
function preLoadCss(cssUrl) {
|
function preLoadCss(cssUrl) {
|
||||||
// https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload
|
||||||
const link = document.createElement("link");
|
const link = document.createElement("link");
|
||||||
@ -210,7 +203,6 @@ function preLoadCss(cssUrl) {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// Sending request for the CSS and the JS files at the same time so it will
|
// Sending request for the CSS and the JS files at the same time so it will
|
||||||
// hopefully be loaded when the JS will generate the settings content.
|
// hopefully be loaded when the JS will generate the settings content.
|
||||||
loadCss(getVar("static-root-path") + getVar("settings-css"));
|
|
||||||
loadScript(getVar("static-root-path") + getVar("settings-js"));
|
loadScript(getVar("static-root-path") + getVar("settings-js"));
|
||||||
preLoadCss(getVar("static-root-path") + getVar("theme-light-css"));
|
preLoadCss(getVar("static-root-path") + getVar("theme-light-css"));
|
||||||
preLoadCss(getVar("static-root-path") + getVar("theme-dark-css"));
|
preLoadCss(getVar("static-root-path") + getVar("theme-dark-css"));
|
||||||
|
@ -91,7 +91,6 @@ macro_rules! static_files {
|
|||||||
|
|
||||||
static_files! {
|
static_files! {
|
||||||
rustdoc_css => "static/css/rustdoc.css",
|
rustdoc_css => "static/css/rustdoc.css",
|
||||||
settings_css => "static/css/settings.css",
|
|
||||||
noscript_css => "static/css/noscript.css",
|
noscript_css => "static/css/noscript.css",
|
||||||
normalize_css => "static/css/normalize.css",
|
normalize_css => "static/css/normalize.css",
|
||||||
main_js => "static/js/main.js",
|
main_js => "static/js/main.js",
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
data-channel="{{rust_channel}}" {#+ #}
|
data-channel="{{rust_channel}}" {#+ #}
|
||||||
data-search-js="{{files.search_js}}" {#+ #}
|
data-search-js="{{files.search_js}}" {#+ #}
|
||||||
data-settings-js="{{files.settings_js}}" {#+ #}
|
data-settings-js="{{files.settings_js}}" {#+ #}
|
||||||
data-settings-css="{{files.settings_css}}" {#+ #}
|
|
||||||
data-theme-light-css="{{files.theme_light_css}}" {#+ #}
|
data-theme-light-css="{{files.theme_light_css}}" {#+ #}
|
||||||
data-theme-dark-css="{{files.theme_dark_css}}" {#+ #}
|
data-theme-dark-css="{{files.theme_dark_css}}" {#+ #}
|
||||||
data-theme-ayu-css="{{files.theme_ayu_css}}" {#+ #}
|
data-theme-ayu-css="{{files.theme_ayu_css}}" {#+ #}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user