Skip to content

Commit

Permalink
fix(styles): checkbox/radio button hover color
Browse files Browse the repository at this point in the history
  • Loading branch information
imagoiq committed Apr 17, 2024
1 parent 67bc6e0 commit 994fc58
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .changeset/large-jokes-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Fixed color and border-color on hover for checkbox and radio form element.
28 changes: 5 additions & 23 deletions packages/styles/src/components/form-check.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
&:hover:not([disabled]),
&:hover:not([disabled]) ~ &-label {
color: var(--post-contrast-color);

@include utility-mx.high-contrast-mode() {
border-color: Highlight;
}
}
}

Expand All @@ -58,40 +62,18 @@
height: form-check.$form-check-input-size;
width: form-check.$form-check-input-size;
border: form-check.$form-check-input-border-width solid
rgba(var(--post-contrast-color-rgb), 0.8);
currentColor;

@include utility-mx.high-contrast-mode {
border-color: FieldText; // For blink-browser as otherwise the default color (which is not a full color) will be converted to Highlight
}

@include utility-mx.high-contrast-mode() {
&:not(:disabled) {
&:hover {
border-color: Highlight;
}
}
}

&::after {
content: '';
display: block;
flex: 1;
}

&:checked,
&:indeterminate {
color: var(--post-contrast-color);
border-color: var(--post-contrast-color);

@include utility-mx.high-contrast-mode {
border-color: FieldText; // Firefox need explicit declaration here
}

~ .form-check-label {
color: var(--post-contrast-color);
}
}

&[type='checkbox'] {
&:checked::after {
@include icons-mx.icon(3035);
Expand Down

0 comments on commit 994fc58

Please sign in to comment.