Skip to content

Commit

Permalink
fix(styles): added hover colors in hcm (#4331)
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Schürch <[email protected]>
  • Loading branch information
schaertim and oliverschuerch authored Dec 19, 2024
1 parent e8d0d36 commit aa7223f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/four-jokes-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Added hover styles in high contrast mode for the css components `Button`, `Chip`, `Form Search` and `Button Close`.
20 changes: 11 additions & 9 deletions packages/styles/src/components/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,19 @@ tokens.$default-map: components.$post-button;

// Styles to improve accessibility in high contrast mode
@include utilities.high-contrast-mode() {
border-color: ButtonBorder;
background-color: ButtonFace;

&:not(:disabled, .disabled) {
&:hover {
border-color: highlight;
&[class] {
border-color: ButtonBorder;
background-color: ButtonFace;

&:not(:disabled, .disabled) {
&:hover {
border-color: highlight;
}
}
}

&:disabled {
border-color: GrayText !important;
&:disabled {
border-color: GrayText !important;
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions packages/styles/src/components/chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
color: chip.$chip-hover-color;
background-color: chip.$chip-hover-bg;

@include utilities.high-contrast-mode() {
border-color: highlight;
}

> .badge {
background-color: chip.$chip-bg;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/styles/src/components/form-search-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ tokens.$default-map: components.$post-search-input;
.search-button {
post-icon {
color: tokens.get('input-color-hover-fg', components.$post-text-input);
@include utilities.high-contrast-mode() {
color: Highlight;
}
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions packages/styles/src/components/icon-close-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ tokens.$default-map: components.$post-close;
background-color: tokens.get('close-enabled-bg');
color: tokens.get('close-enabled-fg');

&:hover {
> post-icon {
@include utilities.high-contrast-mode() {
color: Highlight;
}
}
}

> post-icon {
min-width: tokens.get('close-icon-size');
width: tokens.get('close-icon-size');
Expand Down

0 comments on commit aa7223f

Please sign in to comment.