-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathvaadin-overlay-styles.js
67 lines (56 loc) · 1.93 KB
/
vaadin-overlay-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
/**
* @license
* Copyright (c) 2017 - 2025 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import { css } from 'lit';
export const overlayStyles = css`
:host {
z-index: 200;
position: fixed;
/* Despite of what the names say, <vaadin-overlay> is just a container
for position/sizing/alignment. The actual overlay is the overlay part. */
/* Default position constraints: the entire viewport. Note: themes can
override this to introduce gaps between the overlay and the viewport. */
inset: 0;
bottom: var(--vaadin-overlay-viewport-bottom);
/* Use flexbox alignment for the overlay part. */
display: flex;
flex-direction: column; /* makes dropdowns sizing easier */
/* Align to center by default. */
align-items: center;
justify-content: center;
/* Allow centering when max-width/max-height applies. */
margin: auto;
/* The host is not clickable, only the overlay part is. */
pointer-events: none;
/* Remove tap highlight on touch devices. */
-webkit-tap-highlight-color: transparent;
/* CSS API for host */
--vaadin-overlay-viewport-bottom: 0;
}
:host([hidden]),
:host(:not([opened]):not([closing])),
:host(:not([opened]):not([closing])) [part='overlay'] {
display: none !important;
}
[part='overlay'] {
background: var(--vaadin-overlay-background, var(--_vaadin-background));
border: var(--vaadin-overlay-border, 1px solid var(--_vaadin-border-color));
border-radius: var(--vaadin-overlay-border-radius, var(--_vaadin-radius-m));
box-sizing: border-box;
max-width: 100%;
overflow: auto;
overscroll-behavior: contain;
pointer-events: auto;
-webkit-tap-highlight-color: initial;
}
[part='backdrop'] {
background: rgba(0, 0, 0, 0.5);
content: '';
inset: 0;
pointer-events: auto;
position: fixed;
z-index: -1;
}
`;