Skip to content

Commit

Permalink
fix(button): fix ripple style of button (#1556)
Browse files Browse the repository at this point in the history
Co-authored-by: maxin <maxin@growingio.com>
  • Loading branch information
nnmax and maxin committed Nov 30, 2021
1 parent f90a38c commit e838324
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/button/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
@button-prefix-cls: ~'@{component-prefix}-button';
@icon-button-prefix-cls: ~'@{component-prefix}-icon-button';

@small-height: 30px;
@normal-height: 36px;

// ----------------------- Button Style --------------------------- //
.@{button-prefix-cls} {
@small-height: 30px;
@normal-height: 36px;
position: relative;
display: inline-flex;
align-items: center;
Expand Down Expand Up @@ -107,27 +106,31 @@
}
}

// ripple effect
// ripple effect start
&::after {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
height: 100%;
background: no-repeat 50% radial-gradient(circle, currentColor 10%, transparent 10%);
transform: scale(10, 10);
background-color: currentColor;
border-radius: 0;
transform: scale(1);
opacity: 0;
transition: transform 0.3s, opacity 1s;
transition: border-radius 0.3s, transform 0.3s, opacity 1s;
transition-timing-function: ease-out;
content: '';
pointer-events: none;
}

&:enabled:active::after {
transform: scale(0, 0);
border-radius: 50%;
transform: scale(0, 1);
opacity: 0.3;
transition: 0s;
}
// ripple effect end

&:enabled:active {
.elevation(1);
Expand Down

1 comment on commit e838324

@vercel
Copy link

@vercel vercel bot commented on e838324 Nov 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.