Skip to content

Commit 7ebabde

Browse files
Valent1325Maksim MalofeevMaksim MalofeevMaksim Malofeev
authored
fix(BasicCard): add animation for hover background color (#1334)
* feat(BasicCard): add animation for hover background color * feat(BasicCard): update animation effect for hover background color * feat(BasicCard): fix linter --------- Co-authored-by: Maksim Malofeev <[email protected]> Co-authored-by: Maksim Malofeev <[email protected]> Co-authored-by: Maksim Malofeev <[email protected]>
1 parent b8a15de commit 7ebabde

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

styles/mixins.scss

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,22 @@
248248
}
249249

250250
@mixin background-hover($property: background) {
251-
&:hover {
252-
#{$property}: var(--hover-background-color);
251+
position: relative;
252+
overflow: hidden;
253+
254+
&::before {
255+
content: '';
256+
position: absolute;
257+
inset: 0;
258+
background: var(--hover-background-color);
259+
opacity: 0;
260+
transition: opacity 240ms ease-in;
261+
pointer-events: none;
262+
z-index: -1;
263+
}
264+
265+
&:hover::before {
266+
opacity: 1;
253267
}
254268
}
255269

0 commit comments

Comments
 (0)