-
Notifications
You must be signed in to change notification settings - Fork 16
/
vaadin-select-styles.html
140 lines (113 loc) · 4.05 KB
/
vaadin-select-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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<link rel="import" href="../../../vaadin-lumo-styles/sizing.html">
<link rel="import" href="../../../vaadin-lumo-styles/spacing.html">
<link rel="import" href="../../../vaadin-lumo-styles/style.html">
<link rel="import" href="../../../vaadin-lumo-styles/font-icons.html">
<link rel="import" href="../../../vaadin-lumo-styles/mixins/menu-overlay.html">
<link rel="import" href="../../../vaadin-lumo-styles/mixins/field-button.html">
<link rel="import" href="../../../vaadin-text-field/theme/lumo/vaadin-text-field.html">
<link rel="import" href="../../../vaadin-item/theme/lumo/vaadin-item.html">
<link rel="import" href="../../../vaadin-list-box/theme/lumo/vaadin-list-box.html">
<dom-module id="lumo-select" theme-for="vaadin-select">
<template>
<style include="lumo-field-button">
:host {
outline: none;
-webkit-tap-highlight-color: transparent;
}
[selected] {
padding-left: 0;
padding-right: 0;
flex: auto;
}
:host([theme~="small"]) [selected] {
padding: 0;
min-height: var(--lumo-size-s);
}
:host([theme~="align-left"]) [selected] {
text-align: left;
}
:host([theme~="align-right"]) [selected] {
text-align: right;
}
:host([theme~="align-center"]) [selected] {
text-align: center;
}
[part="toggle-button"]::before {
content: var(--lumo-icons-dropdown);
}
/* Highlight the toggle button when hovering over the entire component */
:host(:hover:not([readonly]):not([disabled])) [part="toggle-button"] {
color: var(--lumo-contrast-80pct);
}
</style>
</template>
</dom-module>
<dom-module id="lumo-select-text-field" theme-for="vaadin-select-text-field">
<template>
<style>
:host([theme~="align-center"]) ::slotted([part~="value"]) {
--_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent 0.25em, #000 1.5em);
}
:host([theme~="align-center"]) ::slotted([part~="value"]) {
--_lumo-text-field-overflow-mask-image: none;
}
:host([theme~="align-right"]) ::slotted([part~="value"]) {
--_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent 0.25em, #000 1.5em);
}
[part="input-field"] {
cursor: default;
}
[part="input-field"] ::slotted([part="value"]) {
display: flex;
}
/* ShadyCSS limitation workaround */
[part="input-field"] ::slotted([part="value"]) [selected]::before {
display: none;
}
[part="input-field"]:focus {
outline: none;
}
/* RTL specific styles */
:host([theme~="align-left"][dir="rtl"]) ::slotted([part~="value"]) {
--_lumo-text-field-overflow-mask-image: linear-gradient(to left, transparent 0.25em, #000 1.5em);
}
:host([theme~="align-center"][dir="rtl"]) ::slotted([part~="value"]) {
--_lumo-text-field-overflow-mask-image: none;
}
:host([dir="rtl"]) ::slotted([part~="value"]),
:host([theme~="align-right"][dir="rtl"]) ::slotted([part~="value"]) {
--_lumo-text-field-overflow-mask-image: linear-gradient(to right, transparent 0.25em, #000 1.5em);
}
</style>
</template>
</dom-module>
<dom-module id="lumo-select-overlay" theme-for="vaadin-select-overlay">
<template>
<style include="lumo-menu-overlay">
:host {
--_lumo-item-selected-icon-display: block;
}
[part~="overlay"] {
min-width: var(--vaadin-select-text-field-width);
}
/* Small viewport adjustment */
:host([phone]) {
top: 0 !important;
right: 0 !important;
bottom: var(--vaadin-overlay-viewport-bottom, 0) !important;
left: 0 !important;
align-items: stretch;
justify-content: flex-end;
}
:host([theme~="align-left"]) {
text-align: left;
}
:host([theme~="align-right"]) {
text-align: right;
}
:host([theme~="align-center"]) {
text-align: center;
}
</style>
</template>
</dom-module>