-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(ripple): Implement subset of improved interaction response guidelines #419
feat(ripple): Implement subset of improved interaction response guidelines #419
Conversation
@cristobalchao if you could do a quick pass on the UX here I'd appreciate it! |
Codecov Report
@@ Coverage Diff @@
## master #419 +/- ##
==========================================
+ Coverage 99.02% 99.16% +0.13%
==========================================
Files 40 40
Lines 2058 2036 -22
Branches 264 260 -4
==========================================
- Hits 2038 2019 -19
+ Misses 20 17 -3
Continue to review full report at Codecov.
|
@@ -20,46 +20,33 @@ | |||
|
|||
@keyframes mdc-ripple-fg-radius-in { | |||
from { | |||
transform: translate(0) scale(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed? Don't we need a fallback for browsers that don't support var?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #361.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BBosman good question. Typically, yes. However, this keyframe is only attached when mdc-ripple-upgraded
is added to the ripple surface. Before we add that class, we check - within JS - to make sure custom properties are supported. Thus, fallbacks here aren't necessary.
...I'm going to add this explanation as a comment 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -20,46 +20,33 @@ | |||
|
|||
@keyframes mdc-ripple-fg-radius-in { | |||
from { | |||
transform: translate(0) scale(1); | |||
transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1); | |||
animation-timing-function: $mdc-animation-fast-out-slow-in-timing-function; | |||
} | |||
|
|||
to { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mdc-ripple-fg-unbounded-transform-deactivate var(--mdc-ripple-fg-unbounded-transform-duration, 0) $mdc-animation-fast-out-slow-in-timing-function; | ||
&.mdc-ripple-upgraded--foreground-deactivation#{$pseudo} { | ||
// Retain transform from mdc-ripple-fg-radius-in activation | ||
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bac68c8
to
cfe9686
Compare
packages/mdc-ripple/constants.js
Outdated
@@ -15,42 +15,33 @@ | |||
*/ | |||
|
|||
export const ROOT = 'mdc-ripple'; | |||
export const UPGRADED = `${ROOT}-upgraded`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It seems like the exported const ROOT
and UPGRADED
is not being used anywhere.
cfe9686
to
ab120d8
Compare
@yeelan0319 Changes made PTAL! |
transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1); | ||
animation-timing-function: $mdc-animation-fast-out-slow-in-timing-function; | ||
} | ||
|
||
to { | ||
transform: translate(0) scale(0); | ||
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 0)); | ||
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why the default value is different from --mdc-ripple-fg-scale
default value (which is 0 and default to 0 else where in _mixins.scss
). Is this a spec change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like an oversight on my part for the --mdc-ripple-fg-scale
default value, which should be set to 1
. Will change.
mdc-ripple-fg-unbounded-transform-deactivate var(--mdc-ripple-fg-unbounded-transform-duration, 0) $mdc-animation-fast-out-slow-in-timing-function; | ||
&.mdc-ripple-upgraded--foreground-deactivation#{$pseudo} { | ||
// Retain transform from mdc-ripple-fg-radius-in activation | ||
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@traviskaufman Moreover since so many changes have been made, I also want to make sure there is no changing to our API and we don't need to make any updates to Given we might need to review code across different components and git doesn't always clever enough to show diff correctly, I feel it might be helpful to provide slightly more high level description about the commit, I found a guideline on Github that we might found useful. |
When the ripple was originally designed from a motion perspective, The UX updates to the ripple remove this distinction of I'll go ahead and add this description above to the commit message. |
ab120d8
to
e32c1fd
Compare
@yeelan0319 changes made PTAL |
…lines for ripple Background === When the ripple was originally designed from a motion perspective, bounded and unbounded activation/deactivation used two different animation styles, distinct from one another. The UX updates to the ripple remove this distinction of bounded vs. unbounded solely with regard to how the ripple animates in and out. There is still a distinction between bounded vs. unbounded, but we no longer have to account for this when animating the ripple. Thus, there are no API changes; only UX changes. Changes === - Implement UX changes for "tap" + "tap and hold" interactions - Remove all references of "bounded" vs. "unbounded" from activation/deactivation code Resolves #190
e32c1fd
to
322f2b6
Compare
Cool. Thanks Travis. This feedback is useful 👍 🌟 |
…lines (material-components#419) Background === When the ripple was originally designed from a motion perspective, bounded and unbounded activation/deactivation used two different animation styles, distinct from one another. The UX updates to the ripple remove this distinction of bounded vs. unbounded solely with regard to how the ripple animates in and out. There is still a distinction between bounded vs. unbounded, but we no longer have to account for this when animating the ripple. Thus, there are no API changes; only UX changes. Changes === - Implement UX changes for "tap" + "tap and hold" interactions - Remove all references of "bounded" vs. "unbounded" from activation/deactivation code Resolves material-components#190
Background
When the ripple was originally designed from a motion perspective,
bounded and unbounded activation/deactivation used two different
animation styles, distinct from one another.
The UX updates to the ripple remove this distinction of bounded vs.
unbounded solely with regard to how the ripple animates in and out.
There is still a distinction between bounded vs. unbounded, but we no
longer have to account for this when animating the ripple. Thus, there
are no API changes; only UX changes.
Changes
activation/deactivation code
Resolves #190