Skip to content

Commit

Permalink
fix(styles): added missing hcm styles for radio-button and checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
schaertim committed Dec 18, 2024
1 parent 912198c commit 45c1440
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/rude-shrimps-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Corrected high contrast mode styles for `checkbox` and `radio-button`.
7 changes: 7 additions & 0 deletions packages/styles/src/components/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ $checkbox-icon-indeterminate: url("data:image/svg+xml,<svg width='16' height='16
background-color: Field;
border-color: FieldText;
color: FieldText;
transition: none;
}

&:not([disabled]) {
Expand All @@ -61,6 +62,12 @@ $checkbox-icon-indeterminate: url("data:image/svg+xml,<svg width='16' height='16

&:checked,
&:indeterminate {
@include utility-mx.high-contrast-mode() {
background-color: SelectedItem;
~ label {
color: SelectedItemText;
}
}
&::after {
background-color: currentColor;

Expand Down
6 changes: 6 additions & 0 deletions packages/styles/src/components/radio-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ tokens.$default-map: components.$post-radio-button;
}

&:checked {
@include utility-mx.high-contrast-mode() {
background-color: SelectedItem;
~ label {
color: SelectedItemText !important;
}
}
&::after {
background-color: tokens.get('radio-button-enabled-fg');

Expand Down

0 comments on commit 45c1440

Please sign in to comment.