Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: make settings radio and checks thicker, less contrast #110205

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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: 2 additions & 1 deletion src/librustdoc/html/static/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
height: 1.2rem;
width: 1.2rem;
color: inherit;
border: 1px solid currentColor;
border: 2px solid var(--settings-input-border-color);
outline: none;
-webkit-appearance: none;
cursor: pointer;
Expand Down Expand Up @@ -52,6 +52,7 @@
}
.setting-check input:checked {
background-color: var(--settings-input-color);
border-width: 1px;
}
.setting-radio input:focus, .setting-check input:focus {
box-shadow: 0 0 1px 1px var(--settings-input-color);
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/html/static/css/themes/ayu.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Original by Dempfi (https://github.com/dempfi/ayu)
--main-background-color: #0f1419;
--main-color: #c5c5c5;
--settings-input-color: #ffb454;
--settings-input-border-color: #999;
--settings-button-color: #fff;
--settings-button-border-focus: #e0e0e0;
--sidebar-background-color: #14191f;
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/html/static/css/themes/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
--main-background-color: #353535;
--main-color: #ddd;
--settings-input-color: #2196f3;
--settings-input-border-color: #999;
--settings-button-color: #000;
--settings-button-border-focus: #ffb900;
--sidebar-background-color: #505050;
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/html/static/css/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
--main-background-color: white;
--main-color: black;
--settings-input-color: #2196f3;
--settings-input-border-color: #717171;
--settings-button-color: #000;
--settings-button-border-focus: #717171;
--sidebar-background-color: #F5F5F5;
Expand Down
77 changes: 70 additions & 7 deletions tests/rustdoc-gui/settings.goml
Original file line number Diff line number Diff line change
Expand Up @@ -56,38 +56,49 @@ move-cursor-to: "#settings-menu > a"
assert-css: (
"#theme-dark",
{
"border-color": "rgb(221, 221, 221)",
"border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset",
"border-width": "2px",
},
)
assert-css: ("#theme-light", {"border-color": "rgb(221, 221, 221)", "box-shadow": "none"})
assert-css: ("#theme-light", {"border-color": "rgb(153, 153, 153)", "box-shadow": "none"})
// Let's start with the hover for radio buttons.
move-cursor-to: "#theme-dark"
assert-css: (
"#theme-dark",
{
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset",
"border-width": "2px",
},
)
move-cursor-to: "#theme-light"
assert-css: ("#theme-light", {"border-color": "rgb(33, 150, 243)", "box-shadow": "none"})
assert-css: (
"#theme-light",
{
"border-color": "rgb(33, 150, 243)",
"box-shadow": "none",
"border-width": "2px",
}
)
move-cursor-to: "#theme-ayu"
// Let's now check with the focus for radio buttons.
focus: "#theme-dark"
assert-css: (
"#theme-dark",
{
"border-color": "rgb(221, 221, 221)",
"border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset, rgb(33, 150, 243) 0px 0px 2px 2px",
"border-width": "2px",
},
)
focus: "#theme-light"
assert-css: (
"#theme-light",
{
"border-color": "rgb(221, 221, 221)",
"border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
"border-width": "2px",
},
)
// Now we check we both focus and hover for radio buttons.
Expand All @@ -98,6 +109,7 @@ assert-css: (
{
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(53, 53, 53) 0px 0px 0px 3px inset, rgb(33, 150, 243) 0px 0px 2px 2px",
"border-width": "2px",
},
)
move-cursor-to: "#theme-light"
Expand All @@ -107,6 +119,7 @@ assert-css: (
{
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
"border-width": "2px",
},
)
// Now we check the setting-radio-name is on a different line than the label.
Expand Down Expand Up @@ -142,7 +155,18 @@ assert-css: (
"#auto-hide-large-items",
{
"background-color": "rgb(33, 150, 243)",
"border-color": "rgb(221, 221, 221)",
"border-color": "rgb(153, 153, 153)",
// 1px border when checked
"border-width": "1px",
},
)
assert-css: (
"#auto-hide-method-docs",
{
"background-color": "rgba(0, 0, 0, 0)",
"border-color": "rgb(153, 153, 153)",
// 2px border when unchecked
"border-width": "2px",
},
)
// Let's start with the hover for toggles.
Expand All @@ -152,6 +176,18 @@ assert-css: (
{
"background-color": "rgb(33, 150, 243)",
"border-color": "rgb(33, 150, 243)",
// 1px border when checked
"border-width": "1px",
},
)
move-cursor-to: "#auto-hide-method-docs"
assert-css: (
"#auto-hide-method-docs",
{
"background-color": "rgba(0, 0, 0, 0)",
"border-color": "rgb(33, 150, 243)",
// 2px border when unchecked
"border-width": "2px",
},
)
move-cursor-to: "#settings-menu > a"
Expand All @@ -161,8 +197,21 @@ assert-css: (
"#auto-hide-large-items",
{
"background-color": "rgb(33, 150, 243)",
"border-color": "rgb(221, 221, 221)",
"border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
// 1px border when checked
"border-width": "1px",
},
)
focus: "#auto-hide-method-docs"
assert-css: (
"#auto-hide-method-docs",
{
"background-color": "rgba(0, 0, 0, 0)",
"border-color": "rgb(153, 153, 153)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
// 2px border when unchecked
"border-width": "2px",
},
)
// Now we check we both focus and hover for toggles.
Expand All @@ -174,6 +223,20 @@ assert-css: (
"background-color": "rgb(33, 150, 243)",
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
// 1px border when checked
"border-width": "1px",
},
)
move-cursor-to: "#auto-hide-method-docs"
focus: "#auto-hide-method-docs"
assert-css: (
"#auto-hide-method-docs",
{
"background-color": "rgba(0, 0, 0, 0)",
"border-color": "rgb(33, 150, 243)",
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
// 2px border when unchecked
"border-width": "2px",
},
)

Expand Down