-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathmenu-item-styles.js
More file actions
65 lines (56 loc) · 1.52 KB
/
menu-item-styles.js
File metadata and controls
65 lines (56 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import '../colors/colors.js';
import { css, unsafeCSS } from 'lit';
import { getFocusPseudoClass } from '../../helpers/focus.js';
import { getOverflowDeclarations } from '../../helpers/overflow.js';
export const menuItemStyles = css`
:host {
--d2l-menu-item-lines: 2;
background-color: var(--d2l-menu-background-color);
border-top: 1px solid var(--d2l-menu-border-color);
box-sizing: border-box;
color: var(--d2l-menu-foreground-color);
cursor: pointer;
display: block;
font-size: 0.8rem;
margin-top: -1px;
width: 100%;
}
:host(:hover),
:host([first]:hover) {
background-color: var(--d2l-menu-background-color-hover);
color: var(--d2l-menu-foreground-color-hover);
}
:host(:${unsafeCSS(getFocusPseudoClass())}),
:host([first]:${unsafeCSS(getFocusPseudoClass())}) {
border-radius: 6px;
border-top-color: transparent;
color: var(--d2l-menu-foreground-color-hover);
outline: 2px solid var(--d2l-menu-border-color-hover) !important; /* override reset styles */
outline-offset: -3px;
z-index: 2;
}
:host([disabled]), :host([disabled]:hover) {
cursor: default;
opacity: 0.75;
}
:host([disabled]:${unsafeCSS(getFocusPseudoClass())}) {
cursor: default;
opacity: 0.75;
}
:host([hidden]) {
display: none;
}
:host([first]) {
border-top-color: transparent;
}
.d2l-menu-item-text {
flex: auto;
line-height: 1rem;
${getOverflowDeclarations({ lines: 'var(--d2l-menu-item-lines, 2)' })}
}
.d2l-menu-item-supporting {
flex: 0 0 auto;
line-height: 1rem;
margin-inline-start: 6px;
}
`;