Skip to content

Commit

Permalink
fix: button animation
Browse files Browse the repository at this point in the history
  • Loading branch information
saadeghi committed Mar 11, 2021
1 parent e0d031d commit 5134b75
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/styled/components/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
&:active:focus{
animation: none;
}
&:active:hover:not(.no-animation),
&:active:focus:not(.no-animation){
transform: scale(0.95);
&:active:hover,
&:active:focus{
transform: scale( var(--btn-focus-scale, 0.95) );
}

/* default btn */
Expand Down Expand Up @@ -218,7 +218,7 @@

@keyframes button-pop {
0% {
transform: scale(0.95);
transform: scale( var(--btn-focus-scale, 0.95) );
}
40% {
transform: scale(1.02);
Expand Down
3 changes: 2 additions & 1 deletion src/themes/black.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

--animation-btn: 0;
--animation-input: 0;


--btn-focus-scale: 1;
--btn-text-case: lowercase;
}
2 changes: 2 additions & 0 deletions src/themes/light.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
--padding-card: 2rem;

--btn-text-case: uppercase;
--btn-focus-scale: 0.95;

--navbar-padding: .5rem;
--border-btn: 1px;

Expand Down
1 change: 1 addition & 0 deletions src/utilities/variables.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.no-animation {
--btn-focus-scale: 1;
--animation-btn: 0;
--animation-input: 0;
}
Expand Down

0 comments on commit 5134b75

Please sign in to comment.