Skip to content

Commit c659664

Browse files
devversionandrewseguin
authored andcommitted
feat(material-experimental/mdc-radio): support for density scaling
1 parent 90d294b commit c659664

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/material-experimental/mdc-radio/_radio-theme.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
}
4545
}
4646

47-
@mixin mat-mdc-radio-density($density-scale) {}
47+
@mixin mat-mdc-radio-density($density-scale) {
48+
.mat-mdc-radio-button .mdc-radio {
49+
@include mdc-radio-density($density-scale);
50+
}
51+
}
4852

4953
@mixin mat-mdc-radio-theme($theme) {
5054
$color: mat-get-color-config($theme);

src/material-experimental/mdc-radio/radio.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
[matRippleTrigger]="formField"
2323
[matRippleDisabled]="_isRippleDisabled()"
2424
[matRippleCentered]="true"
25-
[matRippleRadius]="20"
2625
[matRippleAnimation]="_rippleAnimation">
2726
<div class="mat-ripple-element mat-radio-persistent-ripple"></div>
2827
</div>

src/material-experimental/mdc-radio/radio.scss

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@
33
@import '@material/form-field/mixins.import';
44
@import '../mdc-helpers/mdc-helpers';
55
@import '../../cdk/a11y/a11y';
6+
@import '../../material/core/style/layout-common';
67

78
@include mdc-radio-without-ripple($query: $mat-base-styles-query);
89
@include mdc-form-field-core-styles($query: $mat-base-styles-query);
910

1011
// This is necessary because we do not depend on MDC's ripple, but have our own that should be
1112
// positioned correctly. This can be removed once we start using MDC's ripple implementation.
1213
.mat-mdc-radio-button .mat-radio-ripple {
13-
position: absolute;
14-
left: calc(50% - #{$mdc-radio-icon-size});
15-
top: calc(50% - #{$mdc-radio-icon-size});
16-
height: $mdc-radio-icon-size * 2;
17-
width: $mdc-radio-icon-size * 2;
18-
z-index: 1;
14+
@include mat-fill;
15+
1916
pointer-events: none;
17+
border-radius: 50%;
2018

2119
.mat-ripple-element:not(.mat-radio-persistent-ripple) {
2220
opacity: $mdc-radio-ripple-opacity;

0 commit comments

Comments
 (0)