Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(list): Sort CSS so there is no descending specificity #1904

Merged
merged 2 commits into from
Jan 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 22 additions & 25 deletions packages/mdc-list/mdc-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@
@include mdc-typography-overflow-ellipsis;

display: flex;
position: relative;
align-items: center;
justify-content: flex-start;
height: 48px;
padding: 0 $mdc-list-side-padding;
overflow: hidden;

&:focus {
outline: none;
}
}

// "Selected" is ephemeral and likely to change soon. E.g., selecting one or more photos to share in Google Photos.
Expand Down Expand Up @@ -132,6 +138,22 @@
border-radius: 50%;
}

// List items should support states by default, but it should be possible to opt out.
// Direct child combinator is necessary for non-interactive modifier on parent to not match this selector.
:not(.mdc-list--non-interactive) > .mdc-list-item {
@include mdc-ripple-surface;
@include mdc-ripple-radius;
@include mdc-states;
@include mdc-states-activated(primary);
@include mdc-states-selected(primary);

@include mdc-theme-dark(".mdc-list") {
@include mdc-states(white);
@include mdc-states-activated(primary);
@include mdc-states-selected(primary);
}
}

.mdc-list--avatar-list.mdc-list--dense .mdc-list__item {
height: 48px;
}
Expand All @@ -157,31 +179,6 @@ a.mdc-list-item {
}
// stylelint-enable selector-max-type,selector-no-qualifying-type

.mdc-list-item {
position: relative;
overflow: hidden;

&:focus {
outline: none;
}
}

// List items should support states by default, but it should be possible to opt out.
// Direct child combinator is necessary for non-interactive modifier on parent to not match this selector.
:not(.mdc-list--non-interactive) > .mdc-list-item {
@include mdc-ripple-surface;
@include mdc-ripple-radius;
@include mdc-states;
@include mdc-states-activated(primary);
@include mdc-states-selected(primary);

@include mdc-theme-dark(".mdc-list") {
@include mdc-states(white);
@include mdc-states-activated(primary);
@include mdc-states-selected(primary);
}
}

// postcss-bem-linter: define list-divider

.mdc-list-divider {
Expand Down