Skip to content

Commit 96a74db

Browse files
committed
refactor(themes): accessibility color fixes
1 parent b31a07d commit 96a74db

File tree

4 files changed

+72
-2
lines changed

4 files changed

+72
-2
lines changed

src/components/button-group/themes/shared/button/button.material.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ $theme: $material;
6161
:host([selected]) {
6262
[part~='toggle']:active {
6363
background: var-get($theme, 'item-selected-background');
64-
color: var-get($theme, 'item-selected-text-color');
64+
color: var-get($theme, 'item-selected-hover-text-color');
6565
border-color: var-get($theme, 'item-selected-border-color');
6666

6767
::slotted(igc-icon) {
68-
color: var-get($theme, 'item-selected-icon-color');
68+
color: var-get($theme, 'item-selected-hover-icon-color');
6969
}
7070

7171
&::before {

src/components/button/themes/button/shared/button.material.scss

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,28 @@ $outlined-theme: $material-outlined;
2626
transition: all .1s ease-in-out;
2727
}
2828

29+
:host(:not([disabled])[variant='flat']) [part~='base'],
30+
:host(:not(:disabled)[variant='flat']) [part~='base'] {
31+
&:active {
32+
::slotted(igc-icon) {
33+
color: var-get($flat-theme, 'active-foreground');
34+
}
35+
}
36+
}
37+
38+
:host(:not([disabled])[variant='flat']) [part='base focused'],
39+
:host(:not(:disabled)[variant='flat']) [part='base focused'] {
40+
::slotted(igc-icon) {
41+
color: var-get($flat-theme, 'icon-color-hover');
42+
}
43+
44+
&:active {
45+
::slotted(igc-icon) {
46+
color: var-get($flat-theme, 'focus-foreground');
47+
}
48+
}
49+
}
50+
2951
:host(:not([disabled])[variant='outlined']) [part~='base'],
3052
:host(:not(:disabled)[variant='outlined']) [part~='base'] {
3153
&:hover {
@@ -34,12 +56,28 @@ $outlined-theme: $material-outlined;
3456

3557
&:active {
3658
border-color: var-get($outlined-theme, 'active-border-color');
59+
60+
::slotted(igc-icon) {
61+
color: var-get($outlined-theme, 'active-foreground');
62+
}
3763
}
3864
}
3965

4066
:host(:not([disabled])[variant='outlined']) [part='base focused'],
4167
:host(:not(:disabled)[variant='outlined']) [part='base focused'] {
4268
border-color: var-get($outlined-theme, 'focus-visible-border-color');
69+
70+
::slotted(igc-icon) {
71+
color: var-get($outlined-theme, 'focus-visible-foreground');
72+
}
73+
74+
&:active {
75+
border-color: var-get($outlined-theme, 'focus-border-color');
76+
77+
::slotted(igc-icon) {
78+
color: var-get($outlined-theme, 'focus-foreground');
79+
}
80+
}
4381
}
4482

4583
:host(:not([disabled])[variant='contained']) [part~='base'],

src/components/stepper/themes/step/shared/step.common.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,36 @@ $theme: $material;
132132
[part~='subtitle'] {
133133
color: var-get($theme, 'invalid-subtitle-color')
134134
}
135+
136+
[part~='header'] {
137+
background: var-get($theme, 'invalid-step-background');
138+
139+
&:hover {
140+
background: var-get($theme, 'invalid-step-hover-background');
141+
142+
[part~='title'] {
143+
color: var-get($theme, 'invalid-title-hover-color');
144+
}
145+
146+
[part~='subtitle'] {
147+
color: var-get($theme, 'invalid-subtitle-hover-color')
148+
}
149+
}
150+
151+
&:focus,
152+
&:focus-within,
153+
&:active {
154+
background: var-get($theme, 'invalid-step-focus-background');
155+
156+
[part~='title'] {
157+
color: var-get($theme, 'invalid-title-focus-color');
158+
}
159+
160+
[part~='subtitle'] {
161+
color: var-get($theme, 'invalid-subtitle-focus-color')
162+
}
163+
}
164+
}
135165
}
136166

137167
:host([active]) {

stories/stepper.stories.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ const BasicTemplate = ({
167167
>
168168
<igc-step invalid>
169169
<span slot="title">Step1</span>
170+
<span slot="subtitle">Required</span>
170171
<form id="form">
171172
<igc-input
172173
label="First Name"
@@ -179,6 +180,7 @@ const BasicTemplate = ({
179180
180181
<igc-step invalid>
181182
<span slot="title">Step 2</span>
183+
<span slot="subtitle">Required</span>
182184
<form id="form">
183185
<igc-input
184186
label="Last Name"

0 commit comments

Comments
 (0)