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

fix(styles): added missing hcm styles for radio-button and checkbox #4334

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`.
5 changes: 5 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,10 @@ $checkbox-icon-indeterminate: url("data:image/svg+xml,<svg width='16' height='16

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

&::after {
background-color: currentColor;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User can select any color for HCM, the indicator should use the SelectedItemText color to ensure it is always visible.
Same for the radio buttons.


Expand Down
2 changes: 1 addition & 1 deletion packages/styles/src/components/header/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@use 'mixins' as *;

post-header {
ul[slot="meta-navigation"] {
ul[slot='meta-navigation'] {
gap: var(--post-core-dimension-4);

@include media.max(lg) {
Expand Down
4 changes: 4 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,10 @@ tokens.$default-map: components.$post-radio-button;
}

&:checked {
@include utility-mx.high-contrast-mode() {
background-color: SelectedItem;
}

&::after {
background-color: tokens.get('radio-button-enabled-fg');

Expand Down
Loading