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

feat(menu): Remove obsolete pre-states styles; fix dark-mode selector #1739

Merged
merged 2 commits into from
Dec 14, 2017
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
43 changes: 4 additions & 39 deletions packages/mdc-menu/simple/mdc-simple-menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ $mdc-simple-menu-item-fade-duration: .3s;
}

position: relative;
padding: 0 16px;
outline: none;
color: inherit;
text-decoration: none;
Expand All @@ -159,52 +158,18 @@ $mdc-simple-menu-item-fade-duration: .3s;
}
}

// stylelint-disable selector-no-qualifying-type
&--selected.mdc-list-item,
&--selected.mdc-list-item .mdc-list-item__graphic {
@include mdc-theme-prop(color, primary);
}
// stylelint-enable selector-no-qualifying-type

// TODO(sgomes): Revisit when we have interactive lists.
.mdc-list-item::before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
transition: opacity 120ms $mdc-animation-deceleration-curve-timing-function;
border-radius: inherit;
background: currentColor;
opacity: 0;
pointer-events: none;
content: "";
}

.mdc-list-item:focus::before {
opacity: .12;
}

.mdc-list-item:active::before {
// Slightly darker value for visual distinction.
// This allows a full base that has distinct modes.
// Progressive enhancement with ripples will provide complete button spec alignment.
opacity: .18;
}

.mdc-list-item[aria-disabled="true"] {
@include mdc-theme-prop(color, text-disabled-on-light);

@include mdc-theme-dark(".mdc-select") {
@include mdc-theme-dark(".mdc-simple-menu") {
@include mdc-theme-prop(color, text-disabled-on-dark);
}

cursor: default;
}
pointer-events: none;

.mdc-list-item[aria-disabled="true"] {
&:focus::before,
&:active::before {
// TODO(#1495): Disabled menu items shouldn't be focusable, so this style shouldn't be necessary.
&:focus::before {
opacity: 0;
}
}
Expand Down