-
Notifications
You must be signed in to change notification settings - Fork 2
/
vaadin-list-box-styles.html
83 lines (66 loc) · 2.65 KB
/
vaadin-list-box-styles.html
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
74
75
76
77
78
79
80
81
82
83
<link rel="import" href="../../../vaadin-lumo-styles/color.html">
<link rel="import" href="../../../vaadin-lumo-styles/spacing.html">
<link rel="import" href="../../../vaadin-lumo-styles/style.html">
<dom-module id="lumo-list-box" theme-for="vaadin-list-box">
<template>
<style>
:host {
-webkit-tap-highlight-color: transparent;
--_lumo-item-selected-icon-display: var(--_lumo-list-box-item-selected-icon-display, block);
}
/* IE11 flexbox issue workaround (vaadin-items are flex containers with min-height) */
[part="items"] {
display: flex;
flex-direction: column;
}
[part="items"] ::slotted(*) {
flex: none;
}
/* Normal item */
[part="items"] ::slotted(vaadin-item) {
-webkit-tap-highlight-color: var(--lumo-primary-color-10pct);
cursor: default;
}
[part="items"] ::slotted(vaadin-item) {
outline: none;
border-radius: var(--lumo-border-radius);
padding-left: var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius) / 4));
padding-right: calc(var(--lumo-space-l) + var(--lumo-border-radius) / 4);
}
/* Workaround to display checkmark in IE11 when list-box is not used in dropdown-menu */
[part="items"] ::slotted(vaadin-item)::before {
display: var(--_lumo-item-selected-icon-display);
}
/* Hovered item */
/* TODO a workaround until we have "focus-follows-mouse". After that, use the hover style for focus-ring as well */
[part="items"] ::slotted(vaadin-item:hover:not([disabled])) {
background-color: var(--lumo-primary-color-10pct);
}
/* Focused item */
[part="items"] ::slotted([focus-ring]:not([disabled])) {
box-shadow: inset 0 0 0 2px var(--lumo-primary-color-50pct);
}
@media (pointer: coarse) {
[part="items"] ::slotted(vaadin-item:hover:not([disabled])) {
background-color: transparent;
}
[part="items"] ::slotted([focus-ring]:not([disabled])) {
box-shadow: none;
}
}
/* Easily add section dividers */
[part="items"] ::slotted(hr) {
height: 1px;
border: 0;
padding: 0;
margin: var(--lumo-space-s) var(--lumo-border-radius);
background-color: var(--lumo-contrast-10pct);
}
/* RTL specific styles */
:host([dir="rtl"]) [part="items"] ::slotted(vaadin-item) {
padding-left: calc(var(--lumo-space-l) + var(--lumo-border-radius) / 4);
padding-right: var(--_lumo-list-box-item-padding-left, calc(var(--lumo-border-radius) / 4));
}
</style>
</template>
</dom-module>