File tree Expand file tree Collapse file tree 16 files changed +212
-7
lines changed Expand file tree Collapse file tree 16 files changed +212
-7
lines changed Original file line number Diff line number Diff line change 2323 " lit.d.ts" ,
2424 " lit.js" ,
2525 " src" ,
26+ " !src/styles/*-base-styles.d.ts" ,
27+ " !src/styles/*-base-styles.js" ,
2628 " theme" ,
2729 " vaadin-*.d.ts" ,
2830 " vaadin-*.js" ,
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright (c) 2016 - 2025 Vaadin Ltd.
4+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5+ */
6+ import type { CSSResult } from 'lit' ;
7+
8+ export const contextMenuItemStyles : CSSResult ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright (c) 2016 - 2025 Vaadin Ltd.
4+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5+ */
6+ import '@vaadin/component-base/src/style-props.js' ;
7+ import { css } from 'lit' ;
8+ import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-base-styles.js' ;
9+
10+ const menuItemStyles = css `
11+ : host ::after {
12+ background : var (--vaadin-color-subtle );
13+ content : '' ;
14+ display : block;
15+ height : var (--vaadin-icon-size , 1lh );
16+ mask-image : var (--_vaadin-icon-chevron-down );
17+ rotate : -90deg ;
18+ visibility : hidden;
19+ width : var (--vaadin-icon-size , 1lh );
20+ }
21+
22+ : host ([dir = 'rtl' ])::after {
23+ rotate : 90deg ;
24+ }
25+
26+ /* TODO would be nice to only reserve the space for these if
27+ one or mote items in the list is checkable or has child items */
28+ : host ([aria-haspopup = 'true' ])::after ,
29+ : host ([menu-item-checked ]) [part= 'checkmark' ] {
30+ visibility : visible;
31+ }
32+ ` ;
33+
34+ export const contextMenuItemStyles = [ itemStyles , menuItemStyles ] ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright (c) 2016 - 2025 Vaadin Ltd.
4+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5+ */
6+ import type { CSSResult } from 'lit' ;
7+
8+ export const contextMenuItemStyles : CSSResult ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright (c) 2016 - 2025 Vaadin Ltd.
4+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5+ */
6+ import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-core-styles.js' ;
7+
8+ export const contextMenuItemStyles = [ itemStyles ] ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright (c) 2016 - 2025 Vaadin Ltd.
4+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5+ */
6+ import type { CSSResult } from 'lit' ;
7+
8+ export const contextMenuOverlayStyles : CSSResult ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright (c) 2016 - 2025 Vaadin Ltd.
4+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5+ */
6+ import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-base-styles.js' ;
7+ import { menuOverlayStyles } from './vaadin-menu-overlay-base-styles.js' ;
8+
9+ export const contextMenuOverlayStyles = [ overlayStyles , menuOverlayStyles ] ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright (c) 2016 - 2025 Vaadin Ltd.
4+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5+ */
6+ import type { CSSResult } from 'lit' ;
7+
8+ export const menuOverlayStyles : CSSResult ;
Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright (c) 2016 - 2025 Vaadin Ltd.
4+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5+ */
6+ import { css } from 'lit' ;
7+
8+ export const menuOverlayStyles = css `
9+ : host {
10+ align- items: flex- start;
11+ justify- content: flex- start;
12+ }
13+
14+ : host ([right-aligned ]),
15+ : host ([end-aligned ]) {
16+ align-items : flex-end;
17+ }
18+
19+ : host ([bottom-aligned ]) {
20+ justify-content : flex-end;
21+ }
22+
23+ [part = 'content' ] {
24+ padding : var (--vaadin-item-overlay-padding , 4px );
25+ }
26+
27+ /* TODO keyboard focus becomes visible even when navigating the menu with the mouse */
28+ [part = 'overlay' ]: focus-visible {
29+ outline : none;
30+ }
31+ ` ;
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ import { html, LitElement } from 'lit';
77import { defineCustomElement } from '@vaadin/component-base/src/define.js' ;
88import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js' ;
99import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js' ;
10- import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-core-styles.js' ;
1110import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js' ;
1211import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js' ;
1312import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js' ;
13+ import { contextMenuItemStyles } from './styles/vaadin-context-menu-item-core-styles.js' ;
1414
1515/**
1616 * An element used internally by `<vaadin-context-menu>`. Not intended to be used separately.
@@ -28,7 +28,7 @@ class ContextMenuItem extends ItemMixin(ThemableMixin(DirMixin(LumoInjectionMixi
2828 }
2929
3030 static get styles ( ) {
31- return itemStyles ;
31+ return contextMenuItemStyles ;
3232 }
3333
3434 /** @protected */
You can’t perform that action at this time.
0 commit comments