Skip to content

Commit

Permalink
chore(menu): merge HCM styles
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 570482037
  • Loading branch information
asyncLiz authored and copybara-github committed Oct 5, 2023
1 parent 8ae8c02 commit fe17b21
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 44 deletions.
8 changes: 8 additions & 0 deletions menu/internal/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,12 @@
::slotted(:is(md-divider, [role='separator'])) {
margin: 8px 0;
}

@media (forced-colors: active) {
.menu {
border-style: solid;
border-color: CanvasText;
border-width: 1px;
}
}
}
12 changes: 0 additions & 12 deletions menu/internal/forced-colors-styles.scss

This file was deleted.

22 changes: 22 additions & 0 deletions menu/internal/menuitem/_menu-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,26 @@
.selected:not(.disabled) ::slotted(*) {
color: map.get($tokens, 'selected-label-text-color');
}

@media (forced-colors: active) {
:host([disabled]),
:host([disabled]) slot {
color: GrayText;
opacity: 1;
}

.list-item {
position: relative;
}

.list-item.selected::before {
content: '';
position: absolute;
inset: 0;
box-sizing: border-box;
border-radius: inherit;
pointer-events: none;
border: 3px double CanvasText;
}
}
}
26 changes: 0 additions & 26 deletions menu/internal/menuitem/forced-colors-styles.scss

This file was deleted.

3 changes: 1 addition & 2 deletions menu/menu-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import {customElement} from 'lit/decorators.js';

import {styles as forcedColorsStyles} from './internal/menuitem/forced-colors-styles.css.js';
import {MenuItemEl} from './internal/menuitem/menu-item.js';
import {styles} from './internal/menuitem/menu-item-styles.css.js';

Expand Down Expand Up @@ -36,5 +35,5 @@ declare global {
*/
@customElement('md-menu-item')
export class MdMenuItem extends MenuItemEl {
static override styles = [styles, forcedColorsStyles];
static override styles = [styles];
}
3 changes: 1 addition & 2 deletions menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import {customElement} from 'lit/decorators.js';

import {styles as forcedColors} from './internal/forced-colors-styles.css.js';
import {Menu} from './internal/menu.js';
import {styles} from './internal/menu-styles.css.js';

Expand Down Expand Up @@ -72,5 +71,5 @@ declare global {
*/
@customElement('md-menu')
export class MdMenu extends Menu {
static override styles = [styles, forcedColors];
static override styles = [styles];
}
3 changes: 1 addition & 2 deletions select/select-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import {customElement} from 'lit/decorators.js';

import {styles as forcedColorsStyles} from '../menu/internal/menuitem/forced-colors-styles.css.js';
import {styles} from '../menu/internal/menuitem/menu-item-styles.css.js';

// TODO(b/236285090): update with HCM best practices
Expand Down Expand Up @@ -50,5 +49,5 @@ declare global {
*/
@customElement('md-select-option')
export class MdSelectOption extends SelectOptionEl {
static override styles = [styles, forcedColorsStyles];
static override styles = [styles];
}

0 comments on commit fe17b21

Please sign in to comment.