Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(icon-toggle): Use new ripple mixins #1474

Merged
merged 3 commits into from
Oct 26, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions packages/mdc-icon-toggle/mdc-icon-toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

.mdc-icon-toggle {
@include mdc-theme-prop(color, text-secondary-on-light);
@include mdc-ripple-base;
@include mdc-ripple-surface;
// NOTE: The spec denotes specific opacity values to use for different styles of icon buttons,
// either "light", "dark", or "color". Because ripples are made up of two distinct elements,
// we need to use an opacity value such that when two elements of the same color and opacity are
Expand All @@ -38,12 +38,11 @@
// We simply solve this quadratic equation for the nonnegative root between [0, 1].
// E.g. for black 12% opacity:
// https://www.wolframalpha.com/input/?i=x+%2B+x(1+-+x)+%3D+.12,+x+%3C%3D+1,+x+%3E%3D+0
@include mdc-ripple-bg((pseudo: "::before", opacity: .062));
@include mdc-ripple-fg((pseudo: "::after", opacity: .062));
@include mdc-ripple-color(black, .062);
@include mdc-ripple-radius;

@include mdc-theme-dark(".mdc-icon-toggle", true) {
@include mdc-ripple-bg((pseudo: "::before", base-color: white, opacity: .16));
@include mdc-ripple-fg((pseudo: "::after", base-color: white, opacity: .16));
@include mdc-ripple-color(white, .16);
}

display: flex;
Expand Down Expand Up @@ -76,14 +75,12 @@

.mdc-icon-toggle--primary {
@include mdc-theme-prop(color, primary);
@include mdc-ripple-bg((pseudo: "::before", theme-style: primary, opacity: .14));
@include mdc-ripple-fg((pseudo: "::after", theme-style: primary, opacity: .14));
@include mdc-ripple-color(primary, .14);
}

.mdc-icon-toggle--accent {
@include mdc-theme-prop(color, secondary);
@include mdc-ripple-bg((pseudo: "::before", theme-style: secondary, opacity: .14));
@include mdc-ripple-fg((pseudo: "::after", theme-style: secondary, opacity: .14));
@include mdc-ripple-color(secondary, .14);
}

.mdc-icon-toggle--disabled {
Expand Down