Skip to content

Commit

Permalink
feat(radio): Use new ripple mixins, and remove unnecessary mixin (#1476)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The mdc-radio-ripple mixin has been removed; use mdc-ripple-color directly.
  • Loading branch information
kfranqueiro authored Oct 26, 2017
1 parent 0647576 commit 94a826d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
3 changes: 2 additions & 1 deletion demos/radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@import "./common";
@import "../packages/mdc-form-field/mdc-form-field";
@import "../packages/mdc-radio/mdc-radio";
@import "../packages/mdc-ripple/mixins";
@import "../packages/mdc-theme/color-palette";
@import "../packages/mdc-typography/mdc-typography";

Expand All @@ -27,5 +28,5 @@
@include mdc-radio-checked-stroke-color($color);
@include mdc-radio-ink-color($material-color-orange-500);
@include mdc-radio-focus-indicator-color($color);
@include mdc-radio-ripple((base-color: $color));
@include mdc-ripple-color($color, $mdc-radio-ripple-opacity);
}
3 changes: 1 addition & 2 deletions packages/mdc-radio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ Mixin | Description
`mdc-radio-checked-stroke-color($color)` | Sets the stroke color of a checked radio
`mdc-radio-ink-color($color)` | Sets the ink color
`mdc-radio-focus-indicator-color($color)` | Sets the color of the focus indicator
`mdc-radio-ripple-color($ripple-config)` | Sets the ripple to the given [ripple configuration][ripple-readme]

[ripple-readme]: https://github.com/material-components/material-components-web/blob/master/packages/mdc-ripple/README.md
The ripple effect for the Radio Button component is styled using [MDC Ripple](../mdc-ripple) mixins.

### Caveat: Edge and CSS Variables

Expand Down
7 changes: 0 additions & 7 deletions packages/mdc-radio/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,3 @@
@include mdc-theme-prop(background-color, $color, $edgeOptOut: true);
}
}

@mixin mdc-radio-ripple($ripple-config) {
$ripple-config: map-merge((opacity: $mdc-radio-ripple-opacity, radius: 50%), $ripple-config);

@include mdc-ripple-bg(map-merge($ripple-config, (pseudo: "::before")));
@include mdc-ripple-fg(map-merge($ripple-config, (pseudo: "::after")));
}
1 change: 1 addition & 0 deletions packages/mdc-radio/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ $mdc-radio-ui-size: 20px;
$mdc-radio-ui-pct: percentage($mdc-radio-ui-size / $mdc-radio-touch-area);
$mdc-radio-transition-duration: 120ms;
$mdc-radio-ripple-opacity: .14;
$mdc-radio-ripple-radius: 50%;
$mdc-radio-baseline-theme-color: secondary;
5 changes: 3 additions & 2 deletions packages/mdc-radio/mdc-radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

// postcss-bem-linter: define radio
.mdc-radio {
@include mdc-ripple-base;
@include mdc-radio-unchecked-stroke-color(text-secondary-on-light);

@include mdc-theme-dark {
Expand All @@ -33,7 +32,9 @@
@include mdc-radio-checked-stroke-color($mdc-radio-baseline-theme-color);
@include mdc-radio-ink-color($mdc-radio-baseline-theme-color);
@include mdc-radio-focus-indicator-color($mdc-radio-baseline-theme-color);
@include mdc-radio-ripple((theme-style: $mdc-radio-baseline-theme-color));
@include mdc-ripple-surface;
@include mdc-ripple-color($mdc-radio-baseline-theme-color, $mdc-radio-ripple-opacity);
@include mdc-ripple-radius($mdc-radio-ripple-radius);

display: inline-block;
position: relative;
Expand Down

0 comments on commit 94a826d

Please sign in to comment.