Skip to content

Darken lightswitch background so 3:1 contrast between pane background… #16853

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

1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Improved the accessibility of Tags fields for screen readers. ([#16754](https://github.com/craftcms/cms/pull/16754))
- Removed redundant ARIA roles and labels from reorder buttons. ([#16826](https://github.com/craftcms/cms/pull/16826))
- Animated assets no longer have animated thumbnails. ([#16497](https://github.com/craftcms/cms/pull/16497))
- Improved the contrast of lightswitch inputs. ([#16853](https://github.com/craftcms/cms/pull/16853))

### Content Management
- Window scrolling is now blocked when a modal window is open. ([#16768](https://github.com/craftcms/cms/pull/16768))
Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/css/cp.css.map

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions src/web/assets/cp/src/css/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2843,6 +2843,7 @@ div.btn.submit input {
user-select: none;
background-image: linear-gradient(to right, var(--gray-400), var(--gray-400));
transition: background-image linear 100ms;
box-shadow: inset 0 0 0 1px rgb(0 0 0 / 10%); // Ensures contrast with pane background is over 3:1

&.on {
background-image: linear-gradient(
Expand All @@ -2866,8 +2867,9 @@ div.btn.submit input {

.handle {
position: absolute;
inset-block-start: 1px;
inset-block-start: 2px;
background-color: var(--white);
box-shadow: 0 0 0 1px rgb(0 0 0 / 10%); // Ensures contrast with pane background is over 3:1
}
}

Expand All @@ -2882,10 +2884,10 @@ div.btn.submit input {
width: 46px;

.handle {
border-radius: 10px;
width: 20px;
height: 20px;
inset-inline-start: calc(50% - 10px);
border-radius: 9px;
width: 18px;
height: 18px;
inset-inline-start: calc(50% - 9px);
}
}
}
Expand All @@ -2901,9 +2903,9 @@ div.btn.submit input {

.handle {
border-radius: 8px;
width: 16px;
height: 16px;
inset-inline-start: calc(50% - 8px);
width: 14px;
height: 14px;
inset-inline-start: calc(50% - 7px);
}
}
}
Expand Down