@@ -21,6 +21,10 @@ import {
2121 controlCornerRadius ,
2222 designUnit ,
2323 disabledOpacity ,
24+ errorFillActive ,
25+ errorFillFocus ,
26+ errorFillHover ,
27+ errorFillRest ,
2428 focusStrokeWidth ,
2529 foregroundOnAccentActive ,
2630 foregroundOnAccentHover ,
@@ -68,6 +72,10 @@ export const checkboxStyles: FoundationElementTemplate<
6872 cursor : pointer;
6973 }
7074
75+ : host (.invalid ) .control {
76+ border-color : ${ errorFillRest } ;
77+ }
78+
7179 .label {
7280 font-family : ${ bodyFont } ;
7381 color : ${ neutralForegroundRest } ;
@@ -116,11 +124,23 @@ export const checkboxStyles: FoundationElementTemplate<
116124 border-color : ${ neutralStrokeActive } ;
117125 }
118126
127+ : host (.invalid : not ([disabled ])) .control : hover {
128+ border-color : ${ errorFillHover } ;
129+ }
130+
131+ : host (.invalid : not ([disabled ])) .control : active {
132+ border-color : ${ errorFillActive } ;
133+ }
134+
119135 : host (: ${ focusVisible } ) .control {
120136 outline : calc (${ focusStrokeWidth } * 1px ) solid ${ accentFillFocus } ;
121137 outline-offset : 2px ;
122138 }
123139
140+ : host (.invalid : ${ focusVisible } ) .control {
141+ outline-color : ${ errorFillFocus } ;
142+ }
143+
124144 : host ([aria-checked = 'true' ]) .control {
125145 background : ${ accentFillRest } ;
126146 border : calc (${ strokeWidth } * 1px ) solid ${ accentFillRest } ;
@@ -131,6 +151,16 @@ export const checkboxStyles: FoundationElementTemplate<
131151 border : calc (${ strokeWidth } * 1px ) solid ${ accentFillHover } ;
132152 }
133153
154+ : host (.invalid [aria-checked = 'true' ]) .control {
155+ background-color : ${ errorFillRest } ;
156+ border-color : ${ errorFillRest } ;
157+ }
158+
159+ : host (.invalid [aria-checked = 'true' ]: not ([disabled ])) .control : hover {
160+ background-color : ${ errorFillHover } ;
161+ border-color : ${ errorFillHover } ;
162+ }
163+
134164 : host ([aria-checked = 'true' ]: not ([disabled ]))
135165 .control : hover
136166 .checked-indicator {
@@ -148,6 +178,11 @@ export const checkboxStyles: FoundationElementTemplate<
148178 border : calc (${ strokeWidth } * 1px ) solid ${ accentFillActive } ;
149179 }
150180
181+ : host (.invalid [aria-checked = 'true' ]: not ([disabled ])) .control : active {
182+ background-color : ${ errorFillActive } ;
183+ border-color : ${ errorFillActive } ;
184+ }
185+
151186 : host ([aria-checked = 'true' ]: not ([disabled ]))
152187 .control : active
153188 .checked-indicator {
@@ -165,6 +200,10 @@ export const checkboxStyles: FoundationElementTemplate<
165200 outline-offset : 2px ;
166201 }
167202
203+ : host (.invalid [aria-checked = "true" ]:${ focusVisible } :not ([disabled ])) .control {
204+ outline-color : ${ errorFillFocus } ;
205+ }
206+
168207 : host ([disabled ]) .label ,
169208 : host ([readonly ]) .label ,
170209 : host ([readonly ]) .control ,
@@ -187,6 +226,9 @@ export const checkboxStyles: FoundationElementTemplate<
187226 border-color : ${ SystemColors . FieldText } ;
188227 background : ${ SystemColors . Field } ;
189228 }
229+ : host (.invalid ) .control {
230+ border-style : dashed;
231+ }
190232 .checked-indicator {
191233 fill : ${ SystemColors . FieldText } ;
192234 }
0 commit comments