| 1 |
@use '../../sass-utilities' as *; |
| 2 |
|
| 3 |
@include pf-root($popover) { |
| 4 |
// Component |
| 5 |
--#{$popover}--FontSize: var(--pf-t--global--font--size--body--sm); |
| 6 |
--#{$popover}--MinWidth: calc(var(--#{$popover}__content--PaddingInlineStart) + var(--#{$popover}__content--PaddingInlineEnd) + #{pf-size-prem(300px)}); |
| 7 |
--#{$popover}--MaxWidth: calc(var(--#{$popover}__content--PaddingInlineStart) + var(--#{$popover}__content--PaddingInlineEnd) + #{pf-size-prem(300px)}); |
| 8 |
--#{$popover}--BoxShadow: var(--pf-t--global--box-shadow--md); |
| 9 |
--#{$popover}--BorderWidth: var(--pf-t--global--border--width--high-contrast--regular); |
| 10 |
--#{$popover}--BorderColor: var(--pf-t--global--border--color--high-contrast); |
| 11 |
--#{$popover}--BorderRadius: var(--pf-t--global--border--radius--medium); |
| 12 |
|
| 13 |
|
| 14 |
// Title icon colors for states |
| 15 |
--#{$popover}--m-danger__title-icon--Color: var(--pf-t--global--icon--color--status--danger--default); |
| 16 |
--#{$popover}--m-warning__title-icon--Color: var(--pf-t--global--icon--color--status--warning--default); |
| 17 |
--#{$popover}--m-success__title-icon--Color: var(--pf-t--global--icon--color--status--success--default); |
| 18 |
--#{$popover}--m-info__title-icon--Color: var(--pf-t--global--icon--color--status--info--default); |
| 19 |
--#{$popover}--m-custom__title-icon--Color: var(--pf-t--global--icon--color--status--custom--default); |
| 20 |
|
| 21 |
// Content |
| 22 |
--#{$popover}__content--BackgroundColor: var(--pf-t--global--background--color--floating--default); |
| 23 |
--#{$popover}__content--PaddingBlockStart: var(--pf-t--global--spacer--md); |
| 24 |
--#{$popover}__content--PaddingInlineEnd: var(--pf-t--global--spacer--md); |
| 25 |
--#{$popover}__content--PaddingBlockEnd: var(--pf-t--global--spacer--md); |
| 26 |
--#{$popover}__content--PaddingInlineStart: var(--pf-t--global--spacer--md); |
| 27 |
--#{$popover}__content--BorderRadius: var(--pf-t--global--border--radius--medium); |
| 28 |
|
| 29 |
// Arrow |
| 30 |
--#{$popover}__arrow--Width: #{pf-size-prem(15px)}; |
| 31 |
--#{$popover}__arrow--Height: #{pf-size-prem(15px)}; |
| 32 |
--#{$popover}__arrow--BoxShadow: var(--pf-t--global--box-shadow--md); |
| 33 |
--#{$popover}__arrow--BackgroundColor: var(--pf-t--global--background--color--floating--default); |
| 34 |
--#{$popover}__arrow--m-top--TranslateX: -50%; |
| 35 |
--#{$popover}__arrow--m-top--TranslateY: 50%; |
| 36 |
--#{$popover}__arrow--m-top--Rotate: 45deg; |
| 37 |
--#{$popover}__arrow--m-right--TranslateX: -50%; |
| 38 |
--#{$popover}__arrow--m-right--TranslateY: -50%; |
| 39 |
--#{$popover}__arrow--m-right--Rotate: 45deg; |
| 40 |
--#{$popover}__arrow--m-bottom--TranslateX: -50%; |
| 41 |
--#{$popover}__arrow--m-bottom--TranslateY: -50%; |
| 42 |
--#{$popover}__arrow--m-bottom--Rotate: 45deg; |
| 43 |
--#{$popover}__arrow--m-left--TranslateX: 50%; |
| 44 |
--#{$popover}__arrow--m-left--TranslateY: -50%; |
| 45 |
--#{$popover}__arrow--m-left--Rotate: 45deg; |
| 46 |
--#{$popover}__arrow--m-inline-top--InsetBlockStart: var(--pf-t--global--border--radius--medium); |
| 47 |
--#{$popover}__arrow--m-inline-bottom--InsetBlockEnd: var(--pf-t--global--border--radius--medium); |
| 48 |
--#{$popover}__arrow--m-block-left--InsetInlineStart: var(--pf-t--global--border--radius--medium); |
| 49 |
--#{$popover}__arrow--m-block-right--InsetInlineEnd: var(--pf-t--global--border--radius--medium); |
| 50 |
|
| 51 |
// Close |
| 52 |
--#{$popover}__close--InsetBlockStart: calc(var(--#{$popover}__content--PaddingBlockStart) - var(--pf-t--global--spacer--control--vertical--plain)); // align top of button with top of text |
| 53 |
--#{$popover}__close--InsetInlineEnd: var(--#{$popover}__content--PaddingInlineEnd); // align right of content |
| 54 |
--#{$popover}__close--sibling--PaddingInlineEnd: var(--pf-t--global--spacer--2xl); |
| 55 |
|
| 56 |
// Header |
| 57 |
--#{$popover}__header--MarginBlockEnd: var(--pf-t--global--spacer--sm); |
| 58 |
|
| 59 |
// Title text |
| 60 |
--#{$popover}__title-text--Color: var(--pf-t--global--text--color--regular); |
| 61 |
--#{$popover}__title-text--FontWeight: var(--pf-t--global--font--weight--body--bold); |
| 62 |
--#{$popover}__title-text--FontSize: var(--pf-t--global--font--size--body--default); |
| 63 |
|
| 64 |
// Title icon |
| 65 |
--#{$popover}__title-icon--MarginInlineEnd: var(--pf-t--global--spacer--sm); |
| 66 |
--#{$popover}__title-icon--Color: var(--pf-t--global--icon--color--regular); |
| 67 |
--#{$popover}__title-icon--FontSize: var(--pf-t--global--icon--size--font--body--default); |
| 68 |
|
| 69 |
// Footer |
| 70 |
--#{$popover}__footer--MarginBlockStart: var(--pf-t--global--spacer--md); |
| 71 |
} |
| 72 |
|
| 73 |
.#{$popover} { |
| 74 |
position: relative; |
| 75 |
min-width: var(--#{$popover}--MinWidth); |
| 76 |
max-width: var(--#{$popover}--MaxWidth); |
| 77 |
font-size: var(--#{$popover}--FontSize); |
| 78 |
border: var(--#{$popover}--BorderWidth) solid var(--#{$popover}--BorderColor); |
| 79 |
border-radius: var(--#{$popover}--BorderRadius); |
| 80 |
box-shadow: var(--#{$popover}--BoxShadow); |
| 81 |
|
| 82 |
&.pf-m-no-padding { |
| 83 |
// Use px values below so the min/max-width calc() doesn't break |
| 84 |
// stylelint-disable length-zero-no-unit |
| 85 |
--#{$popover}__content--PaddingBlockStart: 0px; |
| 86 |
--#{$popover}__content--PaddingInlineEnd: 0px; |
| 87 |
--#{$popover}__content--PaddingBlockEnd: 0px; |
| 88 |
--#{$popover}__content--PaddingInlineStart: 0px; |
| 89 |
// stylelint-enable |
| 90 |
} |
| 91 |
|
| 92 |
&.pf-m-width-auto { |
| 93 |
--#{$popover}--MinWidth: auto; |
| 94 |
--#{$popover}--MaxWidth: none; |
| 95 |
} |
| 96 |
|
| 97 |
&:is( |
| 98 |
.pf-m-top, |
| 99 |
.pf-m-top-left, |
| 100 |
.pf-m-top-right |
| 101 |
) { |
| 102 |
--#{$popover}__arrow--InsetBlockEnd: var(--#{$popover}--m-top--InsetBlockEnd, 0); |
| 103 |
--#{$popover}__arrow--InsetInlineStart: var(--#{$popover}--m-top--InsetInlineStart, 50%); |
| 104 |
--#{$popover}__arrow--TranslateX: var(--#{$popover}__arrow--m-top--TranslateX); |
| 105 |
--#{$popover}__arrow--TranslateY: var(--#{$popover}__arrow--m-top--TranslateY); |
| 106 |
--#{$popover}__arrow--Rotate: var(--#{$popover}__arrow--m-top--Rotate); |
| 107 |
} |
| 108 |
|
| 109 |
&:is( |
| 110 |
.pf-m-bottom, |
| 111 |
.pf-m-bottom-left, |
| 112 |
.pf-m-bottom-right |
| 113 |
) { |
| 114 |
--#{$popover}__arrow--InsetBlockStart: var(--#{$popover}--m-bottom--InsetBlockStart, 0); |
| 115 |
--#{$popover}__arrow--InsetInlineStart: var(--#{$popover}--m-bottom--InsetInlineStart, 50%); |
| 116 |
--#{$popover}__arrow--TranslateX: var(--#{$popover}__arrow--m-bottom--TranslateX); |
| 117 |
--#{$popover}__arrow--TranslateY: var(--#{$popover}__arrow--m-bottom--TranslateY); |
| 118 |
--#{$popover}__arrow--Rotate: var(--#{$popover}__arrow--m-bottom--Rotate); |
| 119 |
} |
| 120 |
|
| 121 |
&:is( |
| 122 |
.pf-m-left, |
| 123 |
.pf-m-left-top, |
| 124 |
.pf-m-left-bottom |
| 125 |
) { |
| 126 |
--#{$popover}__arrow--InsetBlockStart: var(--#{$popover}--m-left--InsetBlockStart, 50%); |
| 127 |
--#{$popover}__arrow--InsetInlineEnd: var(--#{$popover}--m-left--InsetInlineEnd, 0); |
| 128 |
--#{$popover}__arrow--TranslateX: var(--#{$popover}__arrow--m-left--TranslateX); |
| 129 |
--#{$popover}__arrow--TranslateY: var(--#{$popover}__arrow--m-left--TranslateY); |
| 130 |
--#{$popover}__arrow--Rotate: var(--#{$popover}__arrow--m-left--Rotate); |
| 131 |
} |
| 132 |
|
| 133 |
&:is( |
| 134 |
.pf-m-right, |
| 135 |
.pf-m-right-top, |
| 136 |
.pf-m-right-bottom |
| 137 |
) { |
| 138 |
--#{$popover}__arrow--InsetBlockStart: var(--#{$popover}--m-right--InsetBlockStart, 50%); |
| 139 |
--#{$popover}__arrow--InsetInlineStart: var(--#{$popover}--m-right--InsetInlineStart, 0); |
| 140 |
--#{$popover}__arrow--TranslateX: var(--#{$popover}__arrow--m-right--TranslateX); |
| 141 |
--#{$popover}__arrow--TranslateY: var(--#{$popover}__arrow--m-right--TranslateY); |
| 142 |
--#{$popover}__arrow--Rotate: var(--#{$popover}__arrow--m-right--Rotate); |
| 143 |
} |
| 144 |
|
| 145 |
&:is( |
| 146 |
.pf-m-left-top, |
| 147 |
.pf-m-right-top |
| 148 |
) { |
| 149 |
--#{$popover}__arrow--InsetBlockStart: var(--#{$popover}__arrow--m-inline-top--InsetBlockStart); |
| 150 |
--#{$popover}__arrow--TranslateY: var(--#{$popover}__arrow--m-top--TranslateY); |
| 151 |
} |
| 152 |
|
| 153 |
&:is( |
| 154 |
.pf-m-left-bottom, |
| 155 |
.pf-m-right-bottom |
| 156 |
) { |
| 157 |
--#{$popover}__arrow--InsetBlockStart: auto; |
| 158 |
--#{$popover}__arrow--InsetBlockEnd: var(--#{$popover}__arrow--m-inline-bottom--InsetBlockEnd); |
| 159 |
} |
| 160 |
|
| 161 |
&:is( |
| 162 |
.pf-m-top-left, |
| 163 |
.pf-m-bottom-left |
| 164 |
) { |
| 165 |
--#{$popover}__arrow--InsetInlineStart: var(--#{$popover}__arrow--m-block-left--InsetInlineStart); |
| 166 |
--#{$popover}__arrow--TranslateX: var(--#{$popover}__arrow--m-left--TranslateX); |
| 167 |
} |
| 168 |
|
| 169 |
&:is( |
| 170 |
.pf-m-top-right, |
| 171 |
.pf-m-bottom-right |
| 172 |
) { |
| 173 |
--#{$popover}__arrow--InsetInlineEnd: var(--#{$popover}__arrow--m-block-right--InsetInlineEnd); |
| 174 |
--#{$popover}__arrow--InsetInlineStart: auto; |
| 175 |
} |
| 176 |
|
| 177 |
&.pf-m-danger { |
| 178 |
--#{$popover}__title-icon--Color: var(--#{$popover}--m-danger__title-icon--Color); |
| 179 |
} |
| 180 |
|
| 181 |
&.pf-m-warning { |
| 182 |
--#{$popover}__title-icon--Color: var(--#{$popover}--m-warning__title-icon--Color); |
| 183 |
} |
| 184 |
|
| 185 |
&.pf-m-success { |
| 186 |
--#{$popover}__title-icon--Color: var(--#{$popover}--m-success__title-icon--Color); |
| 187 |
} |
| 188 |
|
| 189 |
&.pf-m-custom { |
| 190 |
--#{$popover}__title-icon--Color: var(--#{$popover}--m-custom__title-icon--Color); |
| 191 |
} |
| 192 |
|
| 193 |
&.pf-m-info { |
| 194 |
--#{$popover}__title-icon--Color: var(--#{$popover}--m-info__title-icon--Color); |
| 195 |
} |
| 196 |
} |
| 197 |
|
| 198 |
.#{$popover}__content { |
| 199 |
position: relative; |
| 200 |
padding-block-start: var(--#{$popover}__content--PaddingBlockStart); |
| 201 |
padding-block-end: var(--#{$popover}__content--PaddingBlockEnd); |
| 202 |
padding-inline-start: var(--#{$popover}__content--PaddingInlineStart); |
| 203 |
padding-inline-end: var(--#{$popover}__content--PaddingInlineEnd); |
| 204 |
background-color: var(--#{$popover}__content--BackgroundColor); |
| 205 |
border-radius: var(--#{$popover}__content--BorderRadius); |
| 206 |
} |
| 207 |
|
| 208 |
// Close button |
| 209 |
.#{$popover}__close { |
| 210 |
position: absolute; |
| 211 |
inset-block-start: var(--#{$popover}__close--InsetBlockStart); |
| 212 |
inset-inline-end: var(--#{$popover}__close--InsetInlineEnd); |
| 213 |
|
| 214 |
// Create room for the close button |
| 215 |
+ * { |
| 216 |
padding-inline-end: var(--#{$popover}__close--sibling--PaddingInlineEnd); |
| 217 |
} |
| 218 |
} |
| 219 |
|
| 220 |
.#{$popover}__arrow { |
| 221 |
position: absolute; |
| 222 |
// stylelint-disable property-layout-mappings |
| 223 |
top: var(--#{$popover}__arrow--InsetBlockStart, auto); |
| 224 |
right: var(--#{$popover}__arrow--InsetInlineEnd, auto); |
| 225 |
bottom: var(--#{$popover}__arrow--InsetBlockEnd, auto); |
| 226 |
left: var(--#{$popover}__arrow--InsetInlineStart, auto); |
| 227 |
// stylelint-enable |
| 228 |
width: var(--#{$popover}__arrow--Width); |
| 229 |
height: var(--#{$popover}__arrow--Height); |
| 230 |
pointer-events: none; |
| 231 |
background-color: var(--#{$popover}__arrow--BackgroundColor); |
| 232 |
border: var(--#{$popover}--BorderWidth) solid var(--#{$popover}--BorderColor); |
| 233 |
box-shadow: var(--#{$popover}__arrow--BoxShadow); |
| 234 |
transform: translateX(var(--#{$popover}__arrow--TranslateX, 0)) translateY(var(--#{$popover}__arrow--TranslateY, 0)) rotate(var(--#{$popover}__arrow--Rotate, 0)); |
| 235 |
} |
| 236 |
|
| 237 |
.#{$popover}__header { |
| 238 |
margin-block-end: var(--#{$popover}__header--MarginBlockEnd); |
| 239 |
} |
| 240 |
|
| 241 |
.#{$popover}__title { |
| 242 |
display: flex; |
| 243 |
flex: 0 0 auto; |
| 244 |
|
| 245 |
} |
| 246 |
|
| 247 |
.#{$popover}__title-icon { |
| 248 |
margin-inline-end: var(--#{$popover}__title-icon--MarginInlineEnd); |
| 249 |
font-size: var(--#{$popover}__title-icon--FontSize); |
| 250 |
color: var(--#{$popover}__title-icon--Color); |
| 251 |
} |
| 252 |
|
| 253 |
.#{$popover}__title-text { |
| 254 |
min-width: 0; |
| 255 |
font-size: var(--#{$popover}__title-text--FontSize); |
| 256 |
font-weight: var(--#{$popover}__title-text--FontWeight); |
| 257 |
color: var(--#{$popover}__title-text--Color); |
| 258 |
overflow-wrap: break-word; |
| 259 |
} |
| 260 |
|
| 261 |
// Body |
| 262 |
.#{$popover}__body { |
| 263 |
overflow-wrap: break-word; |
| 264 |
} |
| 265 |
|
| 266 |
.#{$popover}__footer { |
| 267 |
margin-block-start: var(--#{$popover}__footer--MarginBlockStart); |
| 268 |
} |