1
- @import " theme" ;
1
+ @use " sass:math" ;
2
+ @import ' theme' ;
2
3
3
4
// OVERRIDABLE CONFIGURATION VARIABLES
4
5
5
6
$pop-over-box-shadow : var (--rp-pop-over-box-shadow , 0 1.5px 5px 0 rgba (0 , 0 , 0 , 0.18 )) !default ;
6
7
$pop-over-font-family : var (--rp-pop-over-font-family , $theme-font-regular ), sans-serif !default ;
7
8
$pop-over-font-size : var (--rp-pop-over-font-size , 14px ) !default ;
8
9
$pop-over-padding : var (--rp-pop-over-padding , 6px 12px ) !default ;
9
- $pop-over-arrow-size : var (--rp-pop-over-arrow-size , 16px ) !default ;
10
+ $pop-over-arrow-width : var (--rp-pop-over-arrow-size , 16px ) !default ;
11
+ $pop-over-arrow-height : calc (#{$pop-over-arrow-width } * #{math .sqrt (2 )} / 2 );
12
+ $pop-over-arrow-nesting : calc (-1 * #{$pop-over-arrow-width } * #{math .sqrt (2 )} / 2 );
10
13
$pop-over-bg-color : var (--rp-pop-over-bg-color , rgba (94 , 96 , 102 , 0.9 )) !default ;
11
14
$pop-over-text-color : var (--rp-pop-over-text-color , white ) !default ;
12
15
$pop-over-line-height : var (--rp-pop-over-line-height , 19px ) !default ;
@@ -22,22 +25,22 @@ $pop-over-border-color: var(--rp-pop-over-border-color, transparent) !default;
22
25
}
23
26
24
27
[data-tippy-root ] {
25
- max-width : calc (100vw - 10px )
28
+ max-width : calc (100vw - 10px );
26
29
}
27
30
28
31
.tippy-box {
29
32
position : relative ;
30
- transition-property : transform , visibility , opacity
33
+ transition-property : transform , visibility , opacity ;
31
34
}
32
35
33
36
.tippy-box [data-inertia ][data-state = visible ] {
34
- transition-timing-function : cubic-bezier (.54 , 1.5 , .38 , 1.11 )
37
+ transition-timing-function : cubic-bezier (.54 , 1.5 , .38 , 1.11 );
35
38
}
36
39
37
40
.tippy-content {
38
41
position : relative ;
39
42
line-height : $pop-over-line-height ;
40
- z-index : 1
43
+ z-index : 1 ;
41
44
}
42
45
}
43
46
@@ -61,13 +64,13 @@ $pop-over-border-color: var(--rp-pop-over-border-color, transparent) !default;
61
64
position : relative ;
62
65
overflow : hidden ;
63
66
display : flex ;
64
- width : calc ( #{ $pop-over-arrow-size } * 1.5 ) ;
65
- height : calc ( #{ $pop-over-arrow-size } * 1.5 ) ;
67
+ width : $pop-over-arrow-width ;
68
+ height : $pop-over-arrow-height ;
66
69
& :before {
67
70
content : " " ;
68
71
display : block ;
69
- width : $pop-over-arrow-size ;
70
- height : $pop-over-arrow-size ;
72
+ width : $pop-over-arrow-width ;
73
+ height : $pop-over-arrow-width ;
71
74
background-color : $pop-over-bg-color ;
72
75
border-width : $pop-over-border-width ;
73
76
border-color : $pop-over-border-color ;
@@ -81,7 +84,7 @@ $pop-over-border-color: var(--rp-pop-over-border-color, transparent) !default;
81
84
justify-content : center ;
82
85
align-items : flex-start ;
83
86
& :before {
84
- margin-top : calc ( -1 * #{ $pop-over-arrow-size } / 2 - #{ $pop-over-border-width } * 2 ) ;
87
+ margin-top : $pop-over-arrow-nesting ;
85
88
}
86
89
}
87
90
@@ -90,25 +93,29 @@ $pop-over-border-color: var(--rp-pop-over-border-color, transparent) !default;
90
93
align-items : flex-end ;
91
94
bottom : 100% ;
92
95
& :before {
93
- margin-bottom : calc ( -1 * #{ $pop-over-arrow-size } / 2 - #{ $pop-over-border-width } * 2 ) ;
96
+ margin-bottom : $pop-over-arrow-nesting ;
94
97
}
95
98
}
96
99
97
100
& [data-placement ^= ' left' ] > :global(.tippy-arrow ) {
98
101
justify-content : flex-start ;
99
102
align-items : center ;
100
103
left : 100% ;
104
+ width : $pop-over-arrow-height ;
105
+ height : $pop-over-arrow-width ;
101
106
& :before {
102
- margin-left : calc ( -1 * #{ $pop-over-arrow-size } / 2 - #{ $pop-over-border-width } * 2 ) ;
107
+ margin-left : $pop-over-arrow-nesting ;
103
108
}
104
109
}
105
110
106
111
& [data-placement ^= ' right' ] > :global(.tippy-arrow ) {
107
112
justify-content : flex-end ;
108
113
align-items : center ;
109
114
right : 100% ;
115
+ width : $pop-over-arrow-height ;
116
+ height : $pop-over-arrow-width ;
110
117
& :before {
111
- margin-right : calc ( -1 * #{ $pop-over-arrow-size } / 2 - #{ $pop-over-border-width } * 2 ) ;
118
+ margin-right : $pop-over-arrow-nesting ;
112
119
}
113
120
}
114
121
}
0 commit comments