Skip to content

Commit 39de594

Browse files
committed
add comments to ripple styles; remove position relative; merge mixins
1 parent 46e35ca commit 39de594

File tree

9 files changed

+54
-74
lines changed

9 files changed

+54
-74
lines changed

src/dev-app/theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
@import '../material/core/theming/all-theme';
22
@import '../material-experimental/mdc-button/mdc-button';
3-
@import '../material-experimental/mdc-button/mdc-icon-button';
4-
@import '../material-experimental/mdc-button/mdc-fab';
53
@import '../material-experimental/mdc-card/mdc-card';
64
@import '../material-experimental/mdc-checkbox/mdc-checkbox';
75
@import '../material-experimental/mdc-helpers/mdc-helpers';

src/e2e-app/theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
@import '../material/core/theming/all-theme';
22
@import '../material-experimental/mdc-button/mdc-button';
3-
@import '../material-experimental/mdc-button/mdc-icon-button';
4-
@import '../material-experimental/mdc-button/mdc-fab';
53
@import '../material-experimental/mdc-card/mdc-card';
64
@import '../material-experimental/mdc-checkbox/mdc-checkbox';
75
@import '../material-experimental/mdc-helpers/mdc-helpers';

src/material-experimental/mdc-button/_mdc-button.scss

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ $_mat-button-ripple-opacity: 0.1;
1313
}
1414

1515
.mat-mdc-button {
16+
// The ripple element is created from the RippleRenderer rather than the MDC ripple, so it is necessary to provide
17+
// the color and opacity styling manually.
1618
.mat-ripple-element {
1719
opacity: $_mat-button-ripple-opacity;
1820
background-color: currentColor;
@@ -30,3 +32,55 @@ $_mat-button-ripple-opacity: 0.1;
3032
@include mdc-button-without-ripple($query: $mat-typography-styles-query);
3133
}
3234
}
35+
36+
@mixin mat-fab-theme-mdc($theme) {
37+
@include mat-using-mdc-theme($theme) {
38+
@include mdc-fab-without-ripple($query: $mat-theme-styles-query);
39+
}
40+
41+
.mat-mdc-button {
42+
// The ripple element is created from the RippleRenderer rather than the MDC ripple, so it is necessary to provide
43+
// the color and opacity styling manually.
44+
.mat-ripple-element {
45+
opacity: $_mat-button-ripple-opacity;
46+
background-color: currentColor;
47+
}
48+
}
49+
}
50+
51+
@mixin mat-fab-typography-mdc($config) {
52+
@if config {
53+
@include mat-using-mdc-typography($config) {
54+
@include mdc-fab-without-ripple($query: $mat-typography-styles-query);
55+
}
56+
}
57+
@else {
58+
@include mdc-fab-without-ripple($query: $mat-typography-styles-query);
59+
}
60+
}
61+
62+
@mixin mat-icon-button-theme-mdc($theme) {
63+
@include mat-using-mdc-theme($theme) {
64+
@include mdc-icon-button-without-ripple($query: $mat-theme-styles-query);
65+
}
66+
67+
.mat-mdc-button {
68+
// The ripple element is created from the RippleRenderer rather than the MDC ripple, so it is necessary to provide
69+
// the color and opacity styling manually.
70+
.mat-ripple-element {
71+
opacity: $_mat-button-ripple-opacity;
72+
background-color: currentColor;
73+
}
74+
}
75+
}
76+
77+
@mixin mat-icon-button-typography-mdc($config) {
78+
@if config {
79+
@include mat-using-mdc-typography($config) {
80+
@include mdc-icon-button-without-ripple($query: $mat-typography-styles-query);
81+
}
82+
}
83+
@else {
84+
@include mdc-icon-button-without-ripple($query: $mat-typography-styles-query);
85+
}
86+
}

src/material-experimental/mdc-button/_mdc-fab.scss

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/material-experimental/mdc-button/_mdc-icon-button.scss

Lines changed: 0 additions & 28 deletions
This file was deleted.

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
@import '../mdc-helpers/mdc-helpers';
33

44
@include mdc-button-without-ripple($query: $mat-base-styles-query);
5-
6-
.mat-mdc-button {
7-
position: relative;
8-
}

src/material-experimental/mdc-button/fab.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
@include mdc-fab-without-ripple($query: $mat-base-styles-query);
55

6-
.mat-mdc-button {
7-
position: relative;
8-
}
9-
106
// MDC expects the fab icon to contain this HTML content:
117
// ```html
128
// <span class="mdc-fab__icon material-icons">favorite</span>

src/material-experimental/mdc-button/icon-button.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
@import '../mdc-helpers/mdc-helpers';
33

44
@include mdc-icon-button-without-ripple($query: $mat-base-styles-query);
5-
6-
.mat-mdc-button {
7-
position: relative;
8-
}

src/universal-app/theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
@import '../material/core/theming/all-theme';
22
@import '../material-experimental/mdc-button/mdc-button';
3-
@import '../material-experimental/mdc-button/mdc-icon-button';
4-
@import '../material-experimental/mdc-button/mdc-fab';
53
@import '../material-experimental/mdc-card/mdc-card';
64
@import '../material-experimental/mdc-checkbox/mdc-checkbox';
75
@import '../material-experimental/mdc-helpers/mdc-helpers';

0 commit comments

Comments
 (0)