Skip to content

Commit

Permalink
feat(menu): Remove obsolete pre-states styles; fix dark-mode selector (
Browse files Browse the repository at this point in the history
…#1739)

BREAKING CHANGE: the "mdc-simple-menu--selected" class is replaced by "mdc-list-item--selected", as it pertains to a specific list item and not the entire menu.
  • Loading branch information
kfranqueiro committed Dec 14, 2017
1 parent c8772ea commit f82998a
Showing 1 changed file with 4 additions and 39 deletions.
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

0 comments on commit f82998a

Please sign in to comment.