-
Notifications
You must be signed in to change notification settings - Fork 13.5k
/
popover.scss
132 lines (104 loc) · 2.71 KB
/
popover.scss
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
@import "./popover.vars";
// Popover
// --------------------------------------------------
:host {
/**
* @prop --background: Background of the popover
* @prop --box-shadow: Box shadow of the popover
*
* @prop --min-width: Minimum width of the popover
* @prop --width: Width of the popover
* @prop --max-width: Maximum width of the popover
*
* @prop --min-height: Minimum height of the popover
* @prop --height: Height of the popover
* @prop --max-height: Maximum height of the popover
*
* @prop --backdrop-opacity: Opacity of the backdrop
*
* @prop --offset-x: The amount to move the popover by on the x-axis
* @prop --offset-y: The amount to move the popover by on the y-axis
*/
--background: #{$popover-background-color};
--min-width: 0;
--min-height: 0;
--max-width: auto;
--height: auto;
--offset-x: 0px;
--offset-y: 0px;
@include position(0, 0, 0, 0);
display: flex;
position: fixed;
align-items: center;
justify-content: center;
outline: none;
color: $popover-text-color;
z-index: $z-index-overlay;
}
/**
* With nested popovers, only the popover that
* was first presented has a popover. This is the
* parent popover and allows us to easily
* track all nested popovers from a single backdrop.
* As a result, nested popovers do not have backdrops
* and their container should not be clickable.
* This ensures that users can click the parent backdrop
* while still interacting with the nested popover inner
* content.
*/
:host(.popover-nested) {
pointer-events: none;
}
:host(.popover-nested) .popover-wrapper {
pointer-events: auto;
}
:host(.overlay-hidden) {
display: none;
}
.popover-wrapper {
z-index: $z-index-overlay-wrapper;
}
.popover-content {
display: flex;
position: absolute;
flex-direction: column;
width: var(--width);
min-width: var(--min-width);
max-width: var(--max-width);
height: var(--height);
min-height: var(--min-height);
max-height: var(--max-height);
background: var(--background);
box-shadow: var(--box-shadow);
overflow: auto;
z-index: $z-index-overlay-wrapper;
}
.popover-viewport {
--ion-safe-area-top: 0px;
--ion-safe-area-right: 0px;
--ion-safe-area-bottom: 0px;
--ion-safe-area-left: 0px;
display: flex;
flex-direction: column;
overflow: hidden;
}
// Nested Popovers
// --------------------------------------------------
:host(.popover-nested.popover-side-left) {
--offset-x: 5px;
}
:host(.popover-nested.popover-side-right) {
--offset-x: -5px;
}
:host(.popover-nested.popover-side-start) {
--offset-x: 5px;
@include rtl() {
--offset-x: -5px;
}
}
:host(.popover-nested.popover-side-end) {
--offset-x: -5px;
@include rtl() {
--offset-x: 5px;
}
}