Skip to content

Commit bb2bb9c

Browse files
authored
refactor(material-experimental/mdc-core): remove underscores from imported mixins (#21060)
* Removes the underscores from the names of mixins that are used in other files. This will become an error when we switch to the Sass module system. * Renames some mixins that were starting with `mdc-` since they can be confused with mixins actually coming from MDC.
1 parent 4399757 commit bb2bb9c

23 files changed

+61
-53
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// color and opacity for states like hover, active, and focus. Additionally, adds styles to the
66
// ripple and state container so that they fill the button, match the border radius, and avoid
77
// pointer events.
8-
@mixin _mat-button-interactive() {
8+
@mixin mat-private-button-interactive() {
99
.mdc-button__ripple::before, .mdc-button__ripple::after {
1010
content: '';
1111
pointer-events: none;
@@ -52,7 +52,7 @@
5252
// TODO(andrewseguin): Discuss with the MDC team about a mixin we can call for applying this style,
5353
// and note that having pointer-events may have unintended side-effects, e.g. allowing the user
5454
// to click the target underneath the button.
55-
@mixin _mat-button-disabled() {
55+
@mixin mat-private-button-disabled() {
5656
&[disabled] {
5757
cursor: default;
5858
pointer-events: none;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
@include mdc-button-without-ripple($query: $mat-base-styles-query);
99

1010
.mat-mdc-button, .mat-mdc-unelevated-button, .mat-mdc-raised-button, .mat-mdc-outlined-button {
11-
@include _mat-button-interactive();
12-
@include _mat-button-disabled();
11+
@include mat-private-button-interactive();
12+
@include mat-private-button-disabled();
1313

1414
// MDC expects button icons to contain this HTML content:
1515
// ```html

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
@include mdc-fab-without-ripple($query: $mat-base-styles-query);
88

99
.mat-mdc-fab, .mat-mdc-mini-fab {
10-
@include _mat-button-interactive();
11-
@include _mat-button-disabled();
10+
@include mat-private-button-interactive();
11+
@include mat-private-button-disabled();
1212

1313
// MDC adds some styles to fab and mini-fab that conflict with some of our focus indicator
1414
// styles and don't actually do anything. This undoes those conflicting styles.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
@include mdc-icon-button-without-ripple($query: $mat-base-styles-query);
66

77
.mat-mdc-icon-button {
8-
@include _mat-button-interactive() {
8+
@include mat-private-button-interactive() {
99
border-radius: 50%;
1010
}
1111

1212
// Border radius is inherited by ripple to know its shape. Set to 50% so the ripple is round.
1313
border-radius: 50%;
1414

15-
@include _mat-button-disabled();
15+
@include mat-private-button-disabled();
1616

1717
// MDC adds some styles to icon buttons that conflict with some of our focus indicator styles
1818
// and don't actually do anything. This undoes those conflicting styles.

src/material-experimental/mdc-checkbox/_checkbox-theme.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Mixin that includes the checkbox theme styles with a given palette.
1212
// By default, the MDC checkbox always uses the `secondary` palette.
13-
@mixin _mdc-checkbox-styles-with-color($color) {
13+
@mixin mat-mdc-private-checkbox-styles-with-color($color) {
1414
@include checkbox-theme.theme((
1515
density-scale: null,
1616
checkmark-color: mdc-theme-prop-value(on-#{$color}),
@@ -42,7 +42,7 @@
4242
$mdc-checkbox-disabled-color: rgba(mdc-theme-prop-value(on-surface), 0.26) !global;
4343

4444
.mat-mdc-checkbox {
45-
@include _mdc-checkbox-styles-with-color(primary);
45+
@include mat-mdc-private-checkbox-styles-with-color(primary);
4646
@include mdc-form-field-core-styles($query: $mat-theme-styles-query);
4747
}
4848

@@ -60,15 +60,15 @@
6060
}
6161

6262
&.mat-accent {
63-
@include _mdc-checkbox-styles-with-color(secondary);
63+
@include mat-mdc-private-checkbox-styles-with-color(secondary);
6464

6565
.mdc-checkbox--selected ~ .mat-mdc-checkbox-ripple .mat-ripple-element {
6666
background: $accent;
6767
}
6868
}
6969

7070
&.mat-warn {
71-
@include _mdc-checkbox-styles-with-color(error);
71+
@include mat-mdc-private-checkbox-styles-with-color(error);
7272

7373
.mdc-checkbox--selected ~ .mat-mdc-checkbox-ripple .mat-ripple-element {
7474
background: $warn;

src/material-experimental/mdc-dialog/_mdc-dialog-structure-overrides.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Mixin that can be included to override the default MDC dialog styles to fit
22
// our needs. See individual comments for context on why certain styles need to be modified.
3-
@mixin _mdc-dialog-structure-overrides() {
3+
@mixin mat-mdc-private-dialog-structure-overrides() {
44
// MDC dialog sets max-height and max-width on the `mdc-dialog__surface` element. This
55
// element is the parent of the portal outlet. This means that the actual user-content
66
// is scrollable, but as per Material Design specification, only the dialog content

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $mat-dialog-content-max-height: 65vh !default;
1212
$mat-dialog-button-horizontal-margin: 8px !default;
1313

1414
@include mdc-dialog-core-styles($query: $mat-base-styles-query);
15-
@include _mdc-dialog-structure-overrides();
15+
@include mat-mdc-private-dialog-structure-overrides();
1616

1717
// The dialog container is focusable. We remove the default outline shown in browsers.
1818
.mat-mdc-dialog-container {

src/material-experimental/mdc-form-field/_form-field-density.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
// provide spacing that makes arbitrary controls align as specified in the Material Design
3636
// specification. In order to support density, we need to adjust the vertical spacing to be
3737
// based on the density scale.
38-
@mixin _mat-mdc-form-field-density($config-or-theme) {
38+
@mixin mat-mdc-private-form-field-density($config-or-theme) {
3939
$density-scale: mat-get-density-config($config-or-theme);
4040
// Height of the form field that is based on the current density scale.
4141
$height: mdc-density-prop-value(

src/material-experimental/mdc-form-field/_form-field-focus-overlay.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
// runtime code for launching interaction ripples at pointer location. This is not needed
1010
// for the text-field, so we create our own minimal focus overlay styles. Our focus overlay
1111
// uses the exact same logic to compute the colors as in the default MDC text-field ripples.
12-
@mixin _mat-mdc-form-field-focus-overlay() {
12+
@mixin mat-mdc-private-form-field-focus-overlay() {
1313
.mat-mdc-form-field-focus-overlay {
1414
@include mat-fill;
1515
opacity: 0;
1616
}
1717
}
1818

19-
@mixin _mat-mdc-form-field-focus-overlay-color() {
19+
@mixin mat-mdc-private-form-field-focus-overlay-color() {
2020
$focus-opacity: ripple-functions.states-opacity($mdc-text-field-ink-color, focus);
2121
$hover-opacity: ripple-functions.states-opacity($mdc-text-field-ink-color, hover);
2222

src/material-experimental/mdc-form-field/_form-field-native-select.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $mat-form-field-select-arrow-height: 5px;
1010
$mat-form-field-select-horizontal-end-padding: $mat-form-field-select-arrow-width + 5px;
1111

1212
// Mixin that creates styles for native select controls in a form-field.
13-
@mixin _mat-mdc-form-field-native-select() {
13+
@mixin mat-mdc-private-form-field-native-select() {
1414
// Remove the native select down arrow and ensure that the native appearance
1515
// does not conflict with the form-field. e.g. Focus indication of the native
1616
// select is undesired since we handle focus as part of the form-field.
@@ -90,7 +90,7 @@ $mat-form-field-select-horizontal-end-padding: $mat-form-field-select-arrow-widt
9090
}
9191
}
9292

93-
@mixin _mat-mdc-form-field-native-select-color($config) {
93+
@mixin mat-mdc-private-form-field-native-select-color($config) {
9494
select.mat-mdc-input-element {
9595
// On dark themes we set the native `select` color to some shade of white,
9696
// however the color propagates to all of the `option` elements, which are

0 commit comments

Comments
 (0)