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): Make styling more coherent for forms elements with High contrast mode and focus/hover state #2774

Merged
merged 29 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ba5450d
fix(styles): Update form validation feedback color and indicators in HCM
imagoiq Mar 6, 2024
182db6a
Lint
imagoiq Mar 6, 2024
26f9e1b
fix(styles): Make styling more coherent for forms elements with High …
imagoiq Mar 11, 2024
fa310ed
Fix using border instead of background to highlight selected state
imagoiq Mar 14, 2024
a67aaf6
Remove commented code
imagoiq Mar 14, 2024
37d27a0
Merge branch 'main' into fix/improve-forms-input-in-hcm
imagoiq Mar 19, 2024
e11a974
Merge branch 'main' into fix/improve-forms-input-in-hcm
imagoiq Mar 21, 2024
d5347d2
Merge branch 'main' into fix/improve-forms-input-in-hcm
imagoiq Mar 21, 2024
9f47f0f
Fixes for card-control
imagoiq Mar 21, 2024
9eac28a
Merge branch 'main' into fix/improve-forms-input-in-hcm
imagoiq Mar 21, 2024
00e55ec
Merge branch 'main' into fix/improve-forms-input-in-hcm
imagoiq Apr 2, 2024
125ba22
Merge branch 'main' into fix/improve-forms-input-in-hcm
imagoiq Apr 3, 2024
bd503f7
Add missing hover state for form-range on hover
imagoiq Apr 4, 2024
e15eeb7
Prototype for simpler version + support for input text and select
imagoiq Apr 4, 2024
01a622c
Remove unneeded prototype for focus-style and remove box-shadow on fo…
imagoiq Apr 8, 2024
995f34e
Add wrapper and styles for input, select and slider
imagoiq Apr 8, 2024
7c96433
Add changelog
imagoiq Apr 8, 2024
f140df2
Improve text input and select on chrome and reinstate hover style for…
imagoiq Apr 8, 2024
71daa2b
Reinstate hover style for checkbox, radio, textarea, switch
imagoiq Apr 8, 2024
fb563db
Consistency on disabled style
imagoiq Apr 8, 2024
9eec980
Fix code smell
imagoiq Apr 8, 2024
d655614
Reinstate selectedItem color
imagoiq Apr 10, 2024
0ee7ed2
Fix issues for checkbox on Firefox
imagoiq Apr 10, 2024
7741117
Extract border-radius from focus-style mixin
imagoiq Apr 10, 2024
15198c9
Merge branch 'main' into fix/improve-forms-input-in-hcm
imagoiq Apr 10, 2024
673040d
Use focus-dark variable
imagoiq Apr 10, 2024
777e6cf
Merge branch 'main' into fix/improve-forms-input-in-hcm
imagoiq Apr 11, 2024
84eac5c
Merge branch 'refs/heads/main' into fix/improve-forms-input-in-hcm
imagoiq Apr 15, 2024
bf998b2
Fix focus form-range focus
imagoiq Apr 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/shy-peas-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

Made styling more coherent for forms elements with High contrast mode and focus/hover state.
31 changes: 24 additions & 7 deletions packages/styles/src/components/form-check.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@
&:indeterminate::after {
@include icons-mx.icon(2039);
}

&:checked,
&:indeterminate {
@include utility-mx.high-contrast-mode {
background-color: SelectedItem !important;
color: SelectedItemText !important; // Important is needed for card-control
}
}
}

&[type='radio'] {
Expand All @@ -84,6 +92,11 @@
background-color: currentColor;
border-radius: inherit;
background-clip: padding-box;

@include utility-mx.high-contrast-mode {
background-color: SelectedItem;
border-color: Canvas;
}
}
}

Expand All @@ -103,6 +116,16 @@
}
}
}

&[type='checkbox'],
&[type='radio'] {
@include utility-mx.high-contrast-mode {
&:hover,
&:focus {
border-color: Highlight;
}
}
}
}

&-label {
Expand Down Expand Up @@ -155,7 +178,7 @@
border: form-check.$form-check-input-border-width solid CanvasText;

&:checked {
background-color: SelectedItem;
background-color: SelectedItem !important;
imagoiq marked this conversation as resolved.
Show resolved Hide resolved
}

&::after,
Expand All @@ -182,12 +205,6 @@

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

&:checked,
&::after,
&:checked::after {
background-color: Highlight;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/styles/src/components/form-range.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
border-color: ButtonText;
}

&:hover,
&:focus-visible {
&::-webkit-slider-thumb {
outline-offset: commons.$border-thick;
Expand Down
Loading