Skip to content

Commit

Permalink
feat(list): Rename deprecated MDC list class names.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 362182613
  • Loading branch information
Brandon Diamond authored and Copybara-Service committed Mar 11, 2021
1 parent 9e52f55 commit a678806
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion packages/mdc-data-table/_data-table-pagination.scss
Expand Up @@ -93,7 +93,7 @@
data-table-theme.$pagination-rows-per-page-select-height,
$query: $query
);
.mdc-list-item {
.mdc-deprecated-list-item {
@include list-theme.deprecated-single-line-height(
data-table-theme.$pagination-rows-per-page-select-height,
$query: $query
Expand Down
8 changes: 4 additions & 4 deletions packages/mdc-dialog/_mixins.scss
Expand Up @@ -272,19 +272,19 @@
}

// stylelint-disable-next-line plugin/selector-bem-pattern
.mdc-dialog__content .mdc-list:first-child:last-child {
.mdc-dialog__content .mdc-deprecated-list:first-child:last-child {
@include feature-targeting.targets($feat-structure) {
// Override default .mdc-list padding for content consisting exclusively of a MDC List
// Override default .mdc-deprecated-list padding for content consisting exclusively of a MDC List
padding: 6px 0 0; // Top padding balances with title height
}
}

// stylelint-disable-next-line plugin/selector-bem-pattern, selector-max-specificity
.mdc-dialog--scrollable
.mdc-dialog__content
.mdc-list:first-child:last-child {
.mdc-deprecated-list:first-child:last-child {
@include feature-targeting.targets($feat-structure) {
// Override default .mdc-list padding for content consisting exclusively of a MDC List
// Override default .mdc-deprecated-list padding for content consisting exclusively of a MDC List
padding: 0;
}
}
Expand Down
22 changes: 11 additions & 11 deletions packages/mdc-drawer/_mixins.scss
Expand Up @@ -283,7 +283,7 @@
}

@mixin activated-overlay-color($color, $query: feature-targeting.all()) {
:not(.mdc-list--non-interactive) > .mdc-list-item {
:not(.mdc-deprecated-list--non-interactive) > .mdc-deprecated-list-item {
@include ripple-theme.states-activated($color, $query: $query);
}
}
Expand Down Expand Up @@ -384,7 +384,7 @@
variables.$item-active-icon-ink-opacity
);

.mdc-list-item--activated {
.mdc-deprecated-list-item--activated {
@include list-mixins.deprecated-item-graphic-ink-color(
$value,
$query: $query
Expand All @@ -398,7 +398,7 @@
variables.$item-active-text-ink-opacity
);

.mdc-list-item--activated {
.mdc-deprecated-list-item--activated {
@include list-mixins.deprecated-item-primary-text-ink-color(
$value,
$query: $query
Expand All @@ -412,7 +412,7 @@
variables.$item-inactive-text-ink-opacity
);

.mdc-list-item {
.mdc-deprecated-list-item {
@include list-mixins.deprecated-item-primary-text-ink-color(
$value,
$query: $query
Expand Down Expand Up @@ -468,7 +468,7 @@
$feat-structure: feature-targeting.create-target($query, structure);

// postcss-bem-linter: ignore
.mdc-list-item {
.mdc-deprecated-list-item {
@include typography.typography(subtitle2, $query: $query);

@include feature-targeting.targets($feat-structure) {
Expand All @@ -480,21 +480,21 @@
}

// postcss-bem-linter: ignore
.mdc-list-item:nth-child(1) {
.mdc-deprecated-list-item:nth-child(1) {
@include feature-targeting.targets($feat-structure) {
margin-top: 2px;
}
}

// postcss-bem-linter: ignore
.mdc-list-item:nth-last-child(1) {
.mdc-deprecated-list-item:nth-last-child(1) {
@include feature-targeting.targets($feat-structure) {
margin-bottom: 0;
}
}

// postcss-bem-linter: ignore
.mdc-list-group__subheader {
.mdc-deprecated-list-group__subheader {
@include typography.typography(body2, $query: $query);
@include typography.text-baseline($top: 24px, $query: $query);

Expand All @@ -505,16 +505,16 @@
}

// postcss-bem-linter: ignore
.mdc-list-divider {
.mdc-deprecated-list-divider {
@include feature-targeting.targets($feat-structure) {
margin: 3px 0 4px;
}
}

// Prevents list item children from being included in the click target.
// postcss-bem-linter: ignore
.mdc-list-item__text,
.mdc-list-item__graphic {
.mdc-deprecated-list-item__text,
.mdc-deprecated-list-item__graphic {
@include feature-targeting.targets($feat-structure) {
pointer-events: none;
}
Expand Down
11 changes: 6 additions & 5 deletions packages/mdc-list/_evolution-mixins.scss
@@ -1,3 +1,7 @@
// Selector '.mdc-*' should only be used in this project.
// stylelint-disable selector-class-pattern --
// NOTE: this is the implementation of the aforementioned classes.

@use 'sass:list';
@use 'sass:map';
@use '@material/theme/theme';
Expand Down Expand Up @@ -89,13 +93,10 @@

// For components using aria-activedescendant, the focus pseudoclass is
// never applied and use `.mdc-ripple-upgraded--background-focused` instead.
// stylelint-disable selector-class-pattern --
// NOTE: Selector '.mdc-*' should only be used in this project.
&:not(.mdc-evolution-list-item--selected):focus::before, // lint-disable-focus-psuedo-selector
&.mdc-ripple-upgraded--background-focused::before {
@include dom-mixins.transparent-border($query: $query);
}
// stylelint-enable selector-class-pattern

&.mdc-evolution-list-item--selected::before {
@include dom-mixins.transparent-border(
Expand Down Expand Up @@ -411,7 +412,7 @@
.mdc-evolution-list-group {
@include feature-targeting.targets($feat-structure) {
// Cancel top/bottom padding on individual lists within group
.mdc-list {
.mdc-deprecated-list {
padding: 0;
}
}
Expand Down Expand Up @@ -839,7 +840,7 @@
@mixin group-subheader-ink-color($color, $query: feature-targeting.all()) {
$feat-color: feature-targeting.create-target($query, color);

.mdc-list-group__subheader {
.mdc-deprecated-list-group__subheader {
@include feature-targeting.targets($feat-color) {
@include theme.property(color, $color);
}
Expand Down
14 changes: 7 additions & 7 deletions packages/mdc-menu/_mixins.scss
Expand Up @@ -55,7 +55,7 @@
);
@include min-width(variables.$min-width, $query: $query);
// Include mdc-list selector to ensure list-inside-menu overrides default list styles
.mdc-list {
.mdc-deprecated-list {
@include list-mixins.deprecated-item-primary-text-ink-color(
variables.$ink-color,
$query
Expand All @@ -64,27 +64,27 @@
@include elevation-mixins.overlay-dimensions(100%, $query: $query);
}

.mdc-list-divider {
.mdc-deprecated-list-divider {
@include feature-targeting.targets($feat-structure) {
margin: 8px 0;
}
}

.mdc-list-item {
.mdc-deprecated-list-item {
@include feature-targeting.targets($feat-structure) {
user-select: none;
}
}

.mdc-list-item--disabled {
.mdc-deprecated-list-item--disabled {
@include feature-targeting.targets($feat-structure) {
cursor: auto;
}
}

//stylelint-disable selector-no-qualifying-type
a.mdc-list-item .mdc-list-item__text,
a.mdc-list-item .mdc-list-item__graphic {
a.mdc-deprecated-list-item .mdc-deprecated-list-item__text,
a.mdc-deprecated-list-item .mdc-deprecated-list-item__graphic {
@include feature-targeting.targets($feat-structure) {
pointer-events: none;
}
Expand All @@ -99,7 +99,7 @@
fill: currentColor;
}

.mdc-list-item {
.mdc-deprecated-list-item {
@include feature-targeting.targets($feat-structure) {
@include rtl-mixins.reflexive-property(
padding,
Expand Down
2 changes: 1 addition & 1 deletion packages/mdc-menu/constants.ts
Expand Up @@ -31,7 +31,7 @@ const strings = {
ARIA_CHECKED_ATTR: 'aria-checked',
ARIA_DISABLED_ATTR: 'aria-disabled',
CHECKBOX_SELECTOR: 'input[type="checkbox"]',
LIST_SELECTOR: '.mdc-list',
LIST_SELECTOR: '.mdc-list,.mdc-deprecated-list',
SELECTED_EVENT: 'MDCMenu:selected',
};

Expand Down
6 changes: 5 additions & 1 deletion packages/mdc-select/_select-ripple.scss
Expand Up @@ -20,6 +20,10 @@
// THE SOFTWARE.
//

// Selector '.mdc-*' should only be used in this project.
// stylelint-disable selector-class-pattern --
// NOTE: this is the implementation of the aforementioned classes.

@use '@material/feature-targeting/feature-targeting';
@use '@material/list/mixins' as list-mixins;
@use '@material/ripple/ripple';
Expand Down Expand Up @@ -55,7 +59,7 @@
}
}

.mdc-select__menu .mdc-list .mdc-list-item--selected {
.mdc-select__menu .mdc-deprecated-list .mdc-deprecated-list-item--selected {
@include list-mixins.deprecated-ripple-states(on-surface, $query: $query);
}
}
8 changes: 6 additions & 2 deletions packages/mdc-select/_select-theme.scss
Expand Up @@ -20,6 +20,10 @@
// THE SOFTWARE.
//

// Selector '.mdc-*' should only be used in this project.
// stylelint-disable selector-class-pattern --
// NOTE: this is the implementation of the aforementioned classes.

@use 'sass:color';
@use 'sass:list';
@use 'sass:meta';
Expand Down Expand Up @@ -683,7 +687,7 @@ $error-color: error !default;
);
}

.mdc-list-item__graphic {
.mdc-deprecated-list-item__graphic {
width: select-icon-theme.$dense-icon-size;
height: select-icon-theme.$dense-icon-size;
}
Expand Down Expand Up @@ -794,7 +798,7 @@ $error-color: error !default;
}

@if $new-height < $height {
.mdc-list-item__graphic {
.mdc-deprecated-list-item__graphic {
width: select-icon-theme.$dense-icon-size;
height: select-icon-theme.$dense-icon-size;
}
Expand Down
10 changes: 7 additions & 3 deletions packages/mdc-select/_select.scss
Expand Up @@ -20,6 +20,10 @@
// THE SOFTWARE.
//

// Selector '.mdc-*' should only be used in this project.
// stylelint-disable selector-class-pattern --
// NOTE: this is the implementation of the aforementioned classes.

@use '@material/dom/mixins' as dom-mixins;
@use '@material/feature-targeting/feature-targeting';
@use '@material/floating-label/mixins' as floating-label-mixins;
Expand Down Expand Up @@ -210,7 +214,7 @@
@include _option-side-padding(12px, $query: $query);
}

.mdc-select__menu .mdc-list {
.mdc-select__menu .mdc-deprecated-list {
@include select-icon-theme.icon-horizontal-margins(0, 0, $query: $query);
@include list-mixins.deprecated-item-selected-text-color(
on-surface,
Expand Down Expand Up @@ -319,7 +323,7 @@
@mixin _option-side-padding($side-padding, $query: feature-targeting.all()) {
$feat-structure: feature-targeting.create-target($query, structure);

.mdc-select__menu .mdc-list-item {
.mdc-select__menu .mdc-deprecated-list-item {
@include feature-targeting.targets($feat-structure) {
@include rtl-mixins.reflexive-property(
padding,
Expand All @@ -340,7 +344,7 @@
) {
$feat-structure: feature-targeting.create-target($query, structure);

.mdc-select__menu .mdc-list-item__graphic {
.mdc-select__menu .mdc-deprecated-list-item__graphic {
@include feature-targeting.targets($feat-structure) {
@include rtl-mixins.reflexive-box(margin, right, $margin-right);
}
Expand Down

0 comments on commit a678806

Please sign in to comment.