Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 57dc62c

Browse files
zacharydentonnshahan
authored andcommitted
Update material-ripple animation to match new spec.
- Overall duration reduced from 418ms to 300ms. - Ripple opacity increased from 14% to 16%. - 4 discrete steps in animation instead of 5. PiperOrigin-RevId: 186534602
1 parent 1eb873c commit 57dc62c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lib/css/material/const/_color.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $mat-dark-opacity-light: .7;
4444
$mat-dark-opacity-lighter: .5;
4545
$mat-dark-opacity-lightest: .3;
4646

47-
$mat-ripple-opacity: .14;
47+
$mat-ripple-opacity: .16;
4848
$mat-divider-opacity: .12;
4949

5050
/// Semi-transparent black/white text as used in most material specs.

lib/material_ripple/material_ripple.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ class MaterialRippleComponent implements OnDestroy {
168168
// dart2js would otherwise wait to initialize them until they are used.
169169
_ripplePool ??= new List<DivElement>(_maxRipples);
170170
_opacityTiming ??= {
171-
'duration': 418.0,
171+
'duration': 300.0,
172172
};
173173
_opacityKeyframes ??= [
174174
{'opacity': _minOpacity},
175-
{'opacity': _maxOpacity, 'offset': 0.2},
176-
{'opacity': _maxOpacity, 'offset': 0.4},
175+
{'opacity': _maxOpacity, 'offset': 0.25},
176+
{'opacity': _maxOpacity, 'offset': 0.5},
177177
{'opacity': _minOpacity},
178178
];
179179
_transformTiming ??= {
180-
'duration': 333.0,
180+
'duration': 225.0,
181181
'easing': 'cubic-bezier(0.4, 0.0, 0.2, 1)',
182182
};
183183
// This is className = instead of classes.add because classes.add compiles

lib/material_ripple/material_ripple.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ material-ripple {
3838
opacity: $min-ripple-opacity;
3939

4040
&.fallback {
41-
animation: __acx-ripple $mat-transition-slow linear;
41+
animation: __acx-ripple $mat-transition-mobile linear;
4242
transform: translateZ(0);
4343
}
4444
}
@@ -49,7 +49,7 @@ material-ripple {
4949
transform: translateZ(0) scale($min-ripple-size / $ripple-size);
5050
}
5151

52-
20%, 40% {
52+
25%, 50% {
5353
opacity: $max-ripple-opacity;
5454
}
5555

lib/utils/color/material.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const darkOpacityLight = 0.7;
2727
const darkOpacityLighter = 0.5;
2828
const darkOpacityLightest = 0.3;
2929

30-
const rippleOpacity = 0.14;
30+
const rippleOpacity = 0.16;
3131
const dividerOpacity = 0.12;
3232

3333
/// SemiTransparent black/white text as used in most material specs.

0 commit comments

Comments
 (0)