Skip to content

Commit 16764f6

Browse files
KiarokhLucyChyzhova
authored andcommitted
chore(mixins): improve the clickable mixins
We often want the same visual feedback on the `hover` and `focus-visible` states.
1 parent 7cb97fc commit 16764f6

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/style/mixins.scss

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ $clickable-normal-state-transitions: (
9090
will-change: color, background-color, box-shadow, transform;
9191
}
9292

93-
&:hover {
93+
&:hover,
94+
&:focus-visible {
9495
transform: translate3d(0, -0.04rem, 0);
9596
color: $color--hovered;
9697
background-color: $background-color--hovered;
@@ -135,10 +136,13 @@ $clickable-normal-state-transitions: (
135136
will-change: color, background-color, box-shadow, transform;
136137
}
137138

138-
&:hover {
139+
&:hover,
140+
&:focus-visible {
139141
transform: translate3d(0, 0.01rem, 0);
140142
color: $color--hovered;
141143
background-color: $background-color--hovered;
144+
}
145+
&:hover {
142146
box-shadow: var(--button-shadow-hovered);
143147
}
144148

@@ -179,10 +183,13 @@ $clickable-normal-state-transitions: (
179183
will-change: color, background-color, box-shadow, transform;
180184
}
181185

182-
&:hover {
186+
&:hover,
187+
&:focus-visible {
183188
transform: translate3d(0, 0.01rem, 0);
184189
color: $color--hovered;
185190
background-color: $background-color--hovered;
191+
}
192+
&:hover {
186193
box-shadow: var(--button-shadow-hovered);
187194
}
188195

@@ -223,10 +230,13 @@ $clickable-normal-state-transitions: (
223230
will-change: color, background-color, box-shadow, transform;
224231
}
225232

226-
&:hover {
233+
&:hover,
234+
&:focus-visible {
227235
transform: translate3d(0, -0.04rem, 0);
228236
color: $color--hovered;
229237
background-color: $background-color--hovered;
238+
}
239+
&:hover {
230240
box-shadow: var(--button-shadow-hovered);
231241
}
232242

0 commit comments

Comments
 (0)