File tree 2 files changed +17
-9
lines changed
source/_patterns/01-elements/chips
2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 11
11
<!-- [html-validate-disable-next prefer-native-element -- TODO: Evaluate again on this HTML] -->
12
12
<label
13
13
for =" chip-single-{{ variant }}{{ id-suffix }} "
14
- role =" button"
15
14
{{ #if variant }} data-variant =" {{ variant }} " {{ /if }}
16
15
{{ #if icon }} data-icon =" {{ icon }} " {{ /if }}
17
16
{{ #if iconAfter }} data-icon-after =" {{ iconAfter }} " {{ /if }}
18
- tabindex =" 0"
19
- aria-hidden =" true"
20
17
>{{ label }} </label >
21
18
{{ else }}
22
19
<!-- [html-validate-disable-next input-missing-label -- label get read out on the input field already and could get aria hidden] -->
23
20
<input
24
21
class =" elm-chip"
25
22
type =" checkbox"
26
- id =" chip-multiple-{{ variant }}{{ id-suffix }} "
23
+ id =" chip-multiple{{ #if disabled }} -disabled {{ /if }} -{{ variant }}{{ id-suffix }} "
27
24
data-type =" filter"
28
25
{{ #if disabled }} disabled{{ /if }} >
29
26
<!-- [html-validate-disable-next prefer-native-element -- TODO: Evaluate again on this HTML] -->
30
27
<label
31
- for =" chip-multiple-{{ variant }}{{ id-suffix }} "
32
- role =" button"
28
+ for =" chip-multiple{{ #if disabled }} -disabled{{ /if }} -{{ variant }}{{ id-suffix }} "
33
29
{{ #if variant }} data-variant =" {{ variant }} " {{ /if }}
34
30
{{ #if icon }} data-icon =" {{ icon }} " {{ /if }}
35
31
{{ #if iconAfter }} data-icon-after =" {{ iconAfter }} " {{ /if }}
36
- tabindex =" 0"
37
- aria-hidden =" true"
38
32
>{{ label }} </label >
39
33
{{ /if }}
Original file line number Diff line number Diff line change 2
2
3
3
.elm-chip {
4
4
& + label {
5
+ --db-focus-outline-size : max (2px , 0.08em );
6
+
5
7
align-items : center ;
6
8
border : solid 1px $db-color-cool-gray-400 ;
7
9
border-radius : $chip---radius ;
116
118
}
117
119
}
118
120
121
+ & :focus-visible {
122
+ & + label {
123
+ outline : var (--db-focus-outline-size )
124
+ var (--db-focus-outline-style , solid )
125
+ var (--db-focus-outline-color , currentColor );
126
+ outline-offset : var (
127
+ --db-focus-outline-offset ,
128
+ var (--db-focus-outline-size )
129
+ );
130
+ }
131
+ }
132
+
119
133
& [type = " checkbox" ],
120
134
& [type = " radio" ] {
121
- display : none ;
135
+ @include a11y-visually-hidden ( $partial : $partial ) ;
122
136
}
123
137
}
You can’t perform that action at this time.
0 commit comments