|
| 1 | +// stylelint-disable custom-property-empty-line-before |
| 2 | + |
1 | 3 | .popover { |
| 4 | + // scss-docs-start popover-css-vars |
| 5 | + --#{$variable-prefix}popover-zindex: #{$zindex-popover}; |
| 6 | + --#{$variable-prefix}popover-max-width: #{$popover-max-width}; |
| 7 | + @include rfs($popover-font-size, --#{$variable-prefix}popover-font-size); |
| 8 | + --#{$variable-prefix}popover-bg: #{$popover-bg}; |
| 9 | + --#{$variable-prefix}popover-border-width: #{$popover-border-width}; |
| 10 | + --#{$variable-prefix}popover-border-color: #{$popover-border-color}; |
| 11 | + --#{$variable-prefix}popover-border-radius: #{$popover-border-radius}; |
| 12 | + --#{$variable-prefix}popover-box-shadow: #{$popover-box-shadow}; |
| 13 | + --#{$variable-prefix}popover-header-padding-x: #{$popover-header-padding-x}; |
| 14 | + --#{$variable-prefix}popover-header-padding-y: #{$popover-header-padding-y}; |
| 15 | + --#{$variable-prefix}popover-header-color: #{$popover-header-color}; |
| 16 | + --#{$variable-prefix}popover-header-bg: #{$popover-header-bg}; |
| 17 | + --#{$variable-prefix}popover-body-padding-x: #{$popover-body-padding-x}; |
| 18 | + --#{$variable-prefix}popover-body-padding-y: #{$popover-body-padding-y}; |
| 19 | + --#{$variable-prefix}popover-body-color: #{$popover-body-color}; |
| 20 | + --#{$variable-prefix}popover-arrow-width: #{$popover-arrow-width}; |
| 21 | + --#{$variable-prefix}popover-arrow-height: #{$popover-arrow-height}; |
| 22 | + --#{$variable-prefix}popover-arrow-border: var(--#{$variable-prefix}popover-border-color); |
| 23 | + // scss-docs-end popover-css-vars |
| 24 | + |
2 | 25 | position: absolute; |
3 | 26 | top: 0; |
4 | 27 | left: 0 #{"/* rtl:ignore */"}; |
5 | | - z-index: $zindex-popover; |
| 28 | + z-index: var(--#{$variable-prefix}popover-zindex); |
6 | 29 | display: block; |
7 | | - max-width: $popover-max-width; |
| 30 | + max-width: var(--#{$variable-prefix}popover-max-width); |
8 | 31 | // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. |
9 | 32 | // So reset our font and text properties to avoid inheriting weird values. |
10 | 33 | @include reset-text(); |
11 | | - @include font-size($popover-font-size); |
| 34 | + font-size: var(--#{$variable-prefix}popover-font-size); |
12 | 35 | // Allow breaking very long words so they don't overflow the popover's bounds |
13 | 36 | word-wrap: break-word; |
14 | | - background-color: $popover-bg; |
| 37 | + background-color: var(--#{$variable-prefix}popover-bg); |
15 | 38 | background-clip: padding-box; |
16 | | - border: $popover-border-width solid $popover-border-color; |
17 | | - @include border-radius($popover-border-radius); |
18 | | - @include box-shadow($popover-box-shadow); |
| 39 | + border: var(--#{$variable-prefix}popover-border-width) solid var(--#{$variable-prefix}popover-border-color); |
| 40 | + @include border-radius(var(--#{$variable-prefix}popover-border-radius)); |
| 41 | + @include box-shadow(var(--#{$variable-prefix}popover-box-shadow)); |
19 | 42 |
|
20 | 43 | .popover-arrow { |
21 | 44 | position: absolute; |
22 | 45 | display: block; |
23 | | - width: $popover-arrow-width; |
24 | | - height: $popover-arrow-height; |
| 46 | + width: var(--#{$variable-prefix}popover-arrow-width); |
| 47 | + height: var(--#{$variable-prefix}popover-arrow-height); |
25 | 48 |
|
26 | 49 | &::before, |
27 | 50 | &::after { |
|
30 | 53 | content: ""; |
31 | 54 | border-color: transparent; |
32 | 55 | border-style: solid; |
| 56 | + border-width: 0; |
33 | 57 | } |
34 | 58 | } |
35 | 59 | } |
36 | 60 |
|
37 | 61 | .bs-popover-top { |
38 | 62 | > .popover-arrow { |
39 | | - bottom: subtract(-$popover-arrow-height, $popover-border-width); |
| 63 | + bottom: calc((var(--#{$variable-prefix}popover-arrow-height)) * -1); // stylelint-disable-line function-disallowed-list |
| 64 | + |
| 65 | + &::before, |
| 66 | + &::after { |
| 67 | + border-width: var(--#{$variable-prefix}popover-arrow-height) calc(var(--#{$variable-prefix}popover-arrow-width) * .5) 0; // stylelint-disable-line function-disallowed-list |
| 68 | + } |
40 | 69 |
|
41 | 70 | &::before { |
42 | 71 | bottom: 0; |
43 | | - border-width: $popover-arrow-height ($popover-arrow-width * .5) 0; |
44 | | - border-top-color: $popover-arrow-outer-color; |
| 72 | + border-top-color: var(--#{$variable-prefix}popover-arrow-border); |
45 | 73 | } |
46 | 74 |
|
47 | 75 | &::after { |
48 | | - bottom: $popover-border-width; |
49 | | - border-width: $popover-arrow-height ($popover-arrow-width * .5) 0; |
50 | | - border-top-color: $popover-arrow-color; |
| 76 | + bottom: var(--#{$variable-prefix}popover-border-width); |
| 77 | + border-top-color: var(--#{$variable-prefix}popover-bg); |
51 | 78 | } |
52 | 79 | } |
53 | 80 | } |
54 | 81 |
|
55 | 82 | /* rtl:begin:ignore */ |
56 | 83 | .bs-popover-end { |
57 | 84 | > .popover-arrow { |
58 | | - left: subtract(-$popover-arrow-height, $popover-border-width); |
59 | | - width: $popover-arrow-height; |
60 | | - height: $popover-arrow-width; |
| 85 | + left: calc((var(--#{$variable-prefix}popover-arrow-height)) * -1); // stylelint-disable-line function-disallowed-list |
| 86 | + width: var(--#{$variable-prefix}popover-arrow-height); |
| 87 | + height: var(--#{$variable-prefix}popover-arrow-width); |
| 88 | + |
| 89 | + &::before, |
| 90 | + &::after { |
| 91 | + border-width: calc(var(--#{$variable-prefix}popover-arrow-width) * .5) var(--#{$variable-prefix}popover-arrow-height) calc(var(--#{$variable-prefix}popover-arrow-width) * .5) 0; // stylelint-disable-line function-disallowed-list |
| 92 | + } |
61 | 93 |
|
62 | 94 | &::before { |
63 | 95 | left: 0; |
64 | | - border-width: ($popover-arrow-width * .5) $popover-arrow-height ($popover-arrow-width * .5) 0; |
65 | | - border-right-color: $popover-arrow-outer-color; |
| 96 | + border-right-color: var(--#{$variable-prefix}popover-arrow-border); |
66 | 97 | } |
67 | 98 |
|
68 | 99 | &::after { |
69 | | - left: $popover-border-width; |
70 | | - border-width: ($popover-arrow-width * .5) $popover-arrow-height ($popover-arrow-width * .5) 0; |
71 | | - border-right-color: $popover-arrow-color; |
| 100 | + left: var(--#{$variable-prefix}popover-border-width); |
| 101 | + border-right-color: var(--#{$variable-prefix}popover-bg); |
72 | 102 | } |
73 | 103 | } |
74 | 104 | } |
|
77 | 107 |
|
78 | 108 | .bs-popover-bottom { |
79 | 109 | > .popover-arrow { |
80 | | - top: subtract(-$popover-arrow-height, $popover-border-width); |
| 110 | + top: calc((var(--#{$variable-prefix}popover-arrow-height)) * -1); // stylelint-disable-line function-disallowed-list |
| 111 | + |
| 112 | + &::before, |
| 113 | + &::after { |
| 114 | + border-width: 0 calc(var(--#{$variable-prefix}popover-arrow-width) * .5) var(--#{$variable-prefix}popover-arrow-height); // stylelint-disable-line function-disallowed-list |
| 115 | + } |
81 | 116 |
|
82 | 117 | &::before { |
83 | 118 | top: 0; |
84 | | - border-width: 0 ($popover-arrow-width * .5) $popover-arrow-height ($popover-arrow-width * .5); |
85 | | - border-bottom-color: $popover-arrow-outer-color; |
| 119 | + border-bottom-color: var(--#{$variable-prefix}popover-arrow-border); |
86 | 120 | } |
87 | 121 |
|
88 | 122 | &::after { |
89 | | - top: $popover-border-width; |
90 | | - border-width: 0 ($popover-arrow-width * .5) $popover-arrow-height ($popover-arrow-width * .5); |
91 | | - border-bottom-color: $popover-arrow-color; |
| 123 | + top: var(--#{$variable-prefix}popover-border-width); |
| 124 | + border-bottom-color: var(--#{$variable-prefix}popover-bg); |
92 | 125 | } |
93 | 126 | } |
94 | 127 |
|
|
98 | 131 | top: 0; |
99 | 132 | left: 50%; |
100 | 133 | display: block; |
101 | | - width: $popover-arrow-width; |
102 | | - margin-left: -$popover-arrow-width * .5; |
| 134 | + width: var(--#{$variable-prefix}popover-arrow-width); |
| 135 | + margin-left: calc(var(--#{$variable-prefix}popover-arrow-width) * -.5); // stylelint-disable-line function-disallowed-list |
103 | 136 | content: ""; |
104 | | - border-bottom: $popover-border-width solid $popover-header-bg; |
| 137 | + border-bottom: var(--#{$variable-prefix}popover-border-width) solid var(--#{$variable-prefix}popover-header-bg); |
105 | 138 | } |
106 | 139 | } |
107 | 140 |
|
108 | 141 | /* rtl:begin:ignore */ |
109 | 142 | .bs-popover-start { |
110 | 143 | > .popover-arrow { |
111 | | - right: subtract(-$popover-arrow-height, $popover-border-width); |
112 | | - width: $popover-arrow-height; |
113 | | - height: $popover-arrow-width; |
| 144 | + right: calc((var(--#{$variable-prefix}popover-arrow-height)) * -1); // stylelint-disable-line function-disallowed-list |
| 145 | + width: var(--#{$variable-prefix}popover-arrow-height); |
| 146 | + height: var(--#{$variable-prefix}popover-arrow-width); |
| 147 | + |
| 148 | + &::before, |
| 149 | + &::after { |
| 150 | + border-width: calc(var(--#{$variable-prefix}popover-arrow-width) * .5) 0 calc(var(--#{$variable-prefix}popover-arrow-width) * .5) var(--#{$variable-prefix}popover-arrow-height); // stylelint-disable-line function-disallowed-list |
| 151 | + } |
114 | 152 |
|
115 | 153 | &::before { |
116 | 154 | right: 0; |
117 | | - border-width: ($popover-arrow-width * .5) 0 ($popover-arrow-width * .5) $popover-arrow-height; |
118 | | - border-left-color: $popover-arrow-outer-color; |
| 155 | + border-left-color: var(--#{$variable-prefix}popover-arrow-border); |
119 | 156 | } |
120 | 157 |
|
121 | 158 | &::after { |
122 | | - right: $popover-border-width; |
123 | | - border-width: ($popover-arrow-width * .5) 0 ($popover-arrow-width * .5) $popover-arrow-height; |
124 | | - border-left-color: $popover-arrow-color; |
| 159 | + right: var(--#{$variable-prefix}popover-border-width); |
| 160 | + border-left-color: var(--#{$variable-prefix}popover-bg); |
125 | 161 | } |
126 | 162 | } |
127 | 163 | } |
|
145 | 181 |
|
146 | 182 | // Offset the popover to account for the popover arrow |
147 | 183 | .popover-header { |
148 | | - padding: $popover-header-padding-y $popover-header-padding-x; |
| 184 | + padding: var(--#{$variable-prefix}popover-header-padding-y) var(--#{$variable-prefix}popover-header-padding-x); |
149 | 185 | margin-bottom: 0; // Reset the default from Reboot |
150 | 186 | @include font-size($font-size-base); |
151 | | - color: $popover-header-color; |
152 | | - background-color: $popover-header-bg; |
153 | | - border-bottom: $popover-border-width solid $popover-border-color; |
| 187 | + color: var(--#{$variable-prefix}popover-header-color); |
| 188 | + background-color: var(--#{$variable-prefix}popover-header-bg); |
| 189 | + border-bottom: var(--#{$variable-prefix}popover-border-width) solid var(--#{$variable-prefix}popover-border-color); |
154 | 190 | @include border-top-radius($popover-inner-border-radius); |
155 | 191 |
|
156 | 192 | &:empty { |
|
159 | 195 | } |
160 | 196 |
|
161 | 197 | .popover-body { |
162 | | - padding: $popover-body-padding-y $popover-body-padding-x; |
163 | | - color: $popover-body-color; |
| 198 | + padding: var(--#{$variable-prefix}popover-body-padding-y) var(--#{$variable-prefix}popover-body-padding-x); |
| 199 | + color: var(--#{$variable-prefix}popover-body-color); |
164 | 200 | } |
0 commit comments