-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathmenu-item-styles.js
73 lines (64 loc) · 1.6 KB
/
menu-item-styles.js
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
66
67
68
69
70
71
72
73
import '../colors/colors.js';
import { css, unsafeCSS } from 'lit';
import { getFocusPseudoClass } from '../../helpers/focus.js';
export const menuItemStyles = css`
:host {
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 {
-webkit-box-orient: vertical;
display: -webkit-box;
flex: auto;
-webkit-line-clamp: 2;
line-height: 1rem;
overflow-wrap: anywhere;
overflow-x: hidden;
overflow-y: hidden;
white-space: normal;
}
.d2l-menu-item-supporting {
flex: 0 0 auto;
line-height: 1rem;
margin-left: 6px;
}
:host([dir="rtl"]) .d2l-menu-item-supporting {
margin-left: 0;
margin-right: 6px;
}
`;