Skip to content

Commit

Permalink
fix(list): Respect BEM when outputting the base stylesheet. (#1799)
Browse files Browse the repository at this point in the history
Fixes #1748.
  • Loading branch information
simono authored and lynnmercier committed Dec 20, 2017
1 parent 3e53614 commit ee1c0db
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions packages/mdc-list/mdc-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,22 @@
@import "./mixins";
@import "./variables";

// TODO(acdvorak): Find a way to remove parent .mdc-list and .mdc-list-group selectors; they violate BEM.
.mdc-list,
.mdc-list-group {
@include mdc-list-divider-color($mdc-list-divider-color-light);

@include mdc-theme-dark {
@include mdc-list-divider-color($mdc-list-divider-color-dark);
}
}

@at-root {
@include mdc-list-divider-color($mdc-list-divider-color-light);
}

// postcss-bem-linter: define list

.mdc-list {
@include mdc-typography(subheading2);

// TODO(acdvorak): Find a way to remove parent .mdc-list selector; it violates BEM.
@include mdc-list-item-primary-text-ink-color(text-primary-on-background);
@include mdc-list-item-secondary-text-ink-color(text-secondary-on-background);
@include mdc-list-item-graphic-fill-color(transparent);
@include mdc-list-item-graphic-ink-color(text-icon-on-background);
@include mdc-list-item-meta-ink-color(text-hint-on-background);

@include mdc-theme-dark {
@include mdc-list-item-primary-text-ink-color(text-primary-on-dark);
Expand All @@ -59,6 +54,13 @@
list-style-type: none;
}

@at-root {
@include mdc-list-item-secondary-text-ink-color(text-secondary-on-background);
@include mdc-list-item-graphic-fill-color(transparent);
@include mdc-list-item-graphic-ink-color(text-icon-on-background);
@include mdc-list-item-meta-ink-color(text-hint-on-background);
}

.mdc-list--dense {
padding-top: 4px;
padding-bottom: 4px;
Expand Down Expand Up @@ -215,8 +217,6 @@ a.mdc-list-item {
// postcss-bem-linter: define list-group

.mdc-list-group {
@include mdc-list-group-subheader-ink-color(text-primary-on-background);

@include mdc-theme-dark {
@include mdc-list-group-subheader-ink-color(text-primary-on-dark);
}
Expand All @@ -238,4 +238,8 @@ a.mdc-list-item {
}
}

@at-root {
@include mdc-list-group-subheader-ink-color(text-primary-on-background);
}

// postcss-bem-linter: end

0 comments on commit ee1c0db

Please sign in to comment.