| 1 |
@use '../../sass-utilities' as *; |
| 2 |
|
| 3 |
$pf-v6-c-form--m-horizontal--breakpoint-map: build-breakpoint-map("sm", "md", "lg", "xl", "2xl"); |
| 4 |
|
| 5 |
@mixin pf-v6-c-form--m-horizontal { |
| 6 |
// default horizontal styles applied at medium breakpoint |
| 7 |
@media screen and (min-width: $pf-v6-global--breakpoint--md) { |
| 8 |
@content; |
| 9 |
} |
| 10 |
|
| 11 |
// custom xs style since this isn't in our maps - maps are based on mobile first design. This may not even be a valid option based on design but I guess it doesn't hurt to add. |
| 12 |
&-on-xs { |
| 13 |
@media screen and (min-width: $pf-v6-global--breakpoint--xs) { |
| 14 |
@content; |
| 15 |
} |
| 16 |
} |
| 17 |
|
| 18 |
// loop to build the rest of the breakpoints |
| 19 |
@each $breakpoint, $breakpoint-value in $pf-v6-c-form--m-horizontal--breakpoint-map { |
| 20 |
&-on-#{$breakpoint} { |
| 21 |
@include pf-v6-apply-breakpoint($breakpoint) { |
| 22 |
@content; |
| 23 |
} |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
@include pf-root($form) { |
| 29 |
--#{$form}--GridGap: var(--pf-t--global--spacer--gap--group-to-group--vertical--default); |
| 30 |
|
| 31 |
// Group |
| 32 |
--#{$form}__group--Gap: var(--pf-t--global--spacer--gap--group--vertical); |
| 33 |
--#{$form}__group--m-action--MarginBlockStart: var(--pf-t--global--spacer--xl); |
| 34 |
--#{$form}--m-horizontal__group-label--md--GridColumnWidth: #{pf-size-prem(150px)}; |
| 35 |
--#{$form}--m-horizontal__group-label--md--GridColumnGap: var(--pf-t--global--spacer--gap--group--horizontal); |
| 36 |
--#{$form}--m-horizontal__group-control--md--GridColumnWidth: 1fr; |
| 37 |
|
| 38 |
// limit width |
| 39 |
--#{$form}--m-limit-width--MaxWidth: #{pf-size-prem(880px)}; |
| 40 |
|
| 41 |
// Group label |
| 42 |
|
| 43 |
// Terminology and a note on vertical alignment of the group labels: |
| 44 |
// Content area height = Font size |
| 45 |
// Line Box height = Content area * Line Height |
| 46 |
// Leading = Line Box - Content Area |
| 47 |
// Leading is always split evenly above and below the content area (so the content area always sits vertically centered in the line box) |
| 48 |
|
| 49 |
// So, to align the label's baseline with the text input's baseline, we need to calculate the difference between the (content area + top half of leading) of the label and of the control. We'll use the text input as the default control, and we also need to adjust for the border of the text input. |
| 50 |
|
| 51 |
// Calculate the distance from top to baseline by (((font size * line height) + border widths - font size) / 2) + font size |
| 52 |
// group__form-label distance from top to baseline (small font, small line height) is 16.1px |
| 53 |
// group__form-control text input distance from top to baseline (medium font, medium line height) is 21px |
| 54 |
// plus the border width used by the text inputs is 1px |
| 55 |
// So we need to adjust by 21 - 16.1 + 1 = 5.9px |
| 56 |
|
| 57 |
--#{$form}--m-horizontal__group-label--md--PaddingBlockStart: calc((((((var(--pf-t--global--font--size--body--default) * var(--pf-t--global--font--line-height--body)) + (2 * var(--pf-t--global--border--width--control--default))) - var(--pf-t--global--font--size--body--default)) / 2) + var(--pf-t--global--font--size--body--default)) - ((((var(--pf-t--global--font--size--body--sm) * var(--pf-t--global--font--line-height--body)) - var(--pf-t--global--font--size--body--sm)) / 2) + var(--pf-t--global--font--size--body--sm)) + var(--pf-t--global--border--width--control--default)); |
| 58 |
--#{$form}__group-label--PaddingBlockEnd: var(--pf-t--global--spacer--sm); |
| 59 |
|
| 60 |
// Use the no-padding modifier to align form groups that aren't text inputs |
| 61 |
// Use the formula above, except |
| 62 |
// - no adjustment for borders needed |
| 63 |
// - reverse the subtraction so we get a negative number to translate by |
| 64 |
// - controls like checkboxes use the medium font and small line height |
| 65 |
// - This comes out to a difference of 2.3px. |
| 66 |
--#{$form}--m-horizontal__group-label--m-no-padding--md--PaddingBlockStart: 0; |
| 67 |
--#{$form}--m-horizontal__group-label--m-no-padding--md--TranslateY: calc(((((var(--pf-t--global--font--size--body--sm) * var(--pf-t--global--font--line-height--body)) - var(--pf-t--global--font--size--body--sm)) / 2) + var(--pf-t--global--font--size--body--sm)) - ((((var(--pf-t--global--font--size--body--default) * var(--pf-t--global--font--line-height--body)) - var(--pf-t--global--font--size--body--default)) / 2) + var(--pf-t--global--font--size--body--default))); |
| 68 |
|
| 69 |
// Label |
| 70 |
--#{$form}__label--FontSize: var(--pf-t--global--font--size--body--default); |
| 71 |
--#{$form}__label--LineHeight: var(--pf-t--global--font--line-height--body); |
| 72 |
--#{$form}__label--m-disabled--Color: var(--pf-t--global--text--color--disabled); |
| 73 |
--#{$form}__label--hover--Cursor: pointer; |
| 74 |
--#{$form}__label--m-disabled--hover--Cursor: not-allowed; |
| 75 |
|
| 76 |
// Label text |
| 77 |
--#{$form}__label-text--FontWeight: var(--pf-t--global--font--weight--body--bold); |
| 78 |
|
| 79 |
// Required labels |
| 80 |
--#{$form}__label-required--MarginInlineStart: var(--pf-t--global--spacer--xs); |
| 81 |
--#{$form}__label-required--FontSize: var(--pf-t--global--font--size--body--default); |
| 82 |
--#{$form}__label-required--Color: var(--pf-t--global--color--status--danger--default); |
| 83 |
|
| 84 |
// Field level help |
| 85 |
--#{$form}__group-label-help--FontSize: var(--pf-t--global--font--size--body--default); |
| 86 |
|
| 87 |
// Form group label info |
| 88 |
--#{$form}__group-label--m-info--Gap: var(--pf-t--global--spacer--gap--horizontal); |
| 89 |
--#{$form}__group-label-info--FontSize: var(--pf-t--global--font--size--body--sm); |
| 90 |
--#{$form}--m-horizontal__group-label--m-info--Gap: var(--pf-t--global--spacer--gap--group--vertical); |
| 91 |
|
| 92 |
// Group control |
| 93 |
--#{$form}__group-control--m-inline--Gap: var(--pf-t--global--spacer--gap--group--horizontal); |
| 94 |
--#{$form}__group-control__helper-text--MarginBlockEnd: var(--pf-t--global--spacer--xs); |
| 95 |
--#{$form}__group-control--m-stack--Gap: var(--pf-t--global--spacer--gap--group--vertical); |
| 96 |
--#{$form}__group-control--m-stack__helper-text--MarginBlockStart: calc(var(--#{$form}__group-control--m-stack--Gap) * -1 + var(--#{$form}__helper-text--MarginBlockStart--base)); |
| 97 |
|
| 98 |
// Actions |
| 99 |
--#{$form}__actions--child--MarginBlockStart: var(--pf-t--global--spacer--sm); |
| 100 |
--#{$form}__actions--child--MarginInlineEnd: var(--pf-t--global--spacer--sm); |
| 101 |
--#{$form}__actions--child--MarginBlockEnd: var(--pf-t--global--spacer--sm); |
| 102 |
--#{$form}__actions--child--MarginInlineStart: var(--pf-t--global--spacer--sm); |
| 103 |
--#{$form}__actions--MarginBlockStart: calc(var(--#{$form}__actions--child--MarginBlockStart) * -1); |
| 104 |
--#{$form}__actions--MarginInlineEnd: calc(var(--#{$form}__actions--child--MarginInlineEnd) * -1); |
| 105 |
--#{$form}__actions--MarginBlockEnd: calc(var(--#{$form}__actions--child--MarginBlockEnd) * -1); |
| 106 |
--#{$form}__actions--MarginInlineStart: calc(var(--#{$form}__actions--child--MarginInlineStart) * -1); |
| 107 |
|
| 108 |
// Helper text |
| 109 |
--#{$form}__helper-text--MarginBlockStart--base: var(--pf-t--global--spacer--xs); |
| 110 |
--#{$form}__helper-text--MarginBlockStart: var(--#{$form}__helper-text--MarginBlockStart--base); |
| 111 |
|
| 112 |
// Section |
| 113 |
--#{$form}__section--MarginBlockStart: var(--pf-t--global--spacer--xl); |
| 114 |
--#{$form}__section--Gap: var(--#{$form}--GridGap); |
| 115 |
|
| 116 |
// Section title |
| 117 |
--#{$form}__section-title--FontSize: var(--pf-t--global--font--size--heading--xs); |
| 118 |
--#{$form}__section-title--FontWeight: var(--pf-t--global--font--weight--heading--default); |
| 119 |
--#{$form}__section-title--MarginBlockEnd: calc(var(--pf-t--global--spacer--sm) * -1); |
| 120 |
|
| 121 |
// Field groups |
| 122 |
--#{$form}__field-group--border-width-base: var(--pf-t--global--border--width--divider--default); |
| 123 |
--#{$form}__field-group--BorderBlockStartWidth: var(--#{$form}__field-group--border-width-base); |
| 124 |
--#{$form}__field-group--BorderBlockStartColor: var(--pf-t--global--border--color--default); |
| 125 |
--#{$form}__field-group--BorderBlockEndWidth: var(--#{$form}__field-group--border-width-base); |
| 126 |
--#{$form}__field-group--BorderBlockEndColor: var(--pf-t--global--border--color--default); |
| 127 |
--#{$form}__field-group--field-group--MarginBlockStart: calc(var(--#{$form}--GridGap) * -1); |
| 128 |
|
| 129 |
// Field group toggle |
| 130 |
--#{$form}__field-group--GridTemplateColumns--toggle: calc(var(--pf-t--global--spacer--md) * 2 + var(--#{$form}__field-group-toggle-icon--MinWidth) + var(--pf-t--global--spacer--xs)); // based off of the expected width of the group toggle, for use to define a column when the toggle is not present |
| 131 |
--#{$form}__field-group-toggle--PaddingBlockStart: var(--#{$form}__field-group-header--PaddingBlockStart); |
| 132 |
--#{$form}__field-group-toggle--PaddingInlineEnd: var(--pf-t--global--spacer--xs); |
| 133 |
--#{$form}__field-group__field-group__field-group-toggle--PaddingBlockStart: var(--pf-t--global--spacer--lg); // remove in breaking change |
| 134 |
--#{$form}__field-group-header-toggle--BorderWidth--base: var(--pf-t--global--border--width--divider--default); |
| 135 |
--#{$form}__field-group__field-group--field-group__field-group-toggle--after--BorderBlockStartWidth: var(--#{$form}__field-group-header-toggle--BorderWidth--base); |
| 136 |
--#{$form}__field-group-toggle-button--MarginBlockStart: calc(var(--pf-t--global--spacer--control--vertical--plain) * -1); |
| 137 |
--#{$form}__field-group-toggle-button--MarginBlockEnd: calc(var(--pf-t--global--spacer--control--vertical--plain) * -1); |
| 138 |
--#{$form}__field-group-toggle-icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--default); |
| 139 |
--#{$form}__field-group-toggle-icon--TransitionTimingFunction: var(--pf-t--global--motion--timing-function--default); |
| 140 |
--#{$form}__field-group-toggle-icon--MinWidth: var(--pf-t--global--font--size--body--default); |
| 141 |
--#{$form}__field-group-toggle-icon--Rotate: 0; |
| 142 |
--#{$form}__field-group--m-expanded__toggle-icon--Rotate: -180deg; |
| 143 |
|
| 144 |
// Field group header |
| 145 |
--#{$form}__field-group-header--PaddingBlockStart: var(--pf-t--global--spacer--md); |
| 146 |
--#{$form}__field-group-header--PaddingBlockEnd: var(--pf-t--global--spacer--md); |
| 147 |
--#{$form}__field-group-header--GridColumn: 1 / 3; |
| 148 |
--#{$form}__field-group__field-group__field-group-header--PaddingBlockStart: var(--pf-t--global--spacer--lg); |
| 149 |
--#{$form}__field-group__field-group__field-group-header--PaddingBlockEnd: var(--pf-t--global--spacer--lg); |
| 150 |
--#{$form}__field-group-toggle--field-group-header--GridColumn: 2 / 3; |
| 151 |
--#{$form}__field-group__field-group--field-group__field-group-header--after--BorderBlockStartWidth: var(--#{$form}__field-group-header-toggle--BorderWidth--base); |
| 152 |
--#{$form}__field-group-header-description--MarginBlockStart: var(--pf-t--global--spacer--xs); |
| 153 |
--#{$form}__field-group-header-description--Color: var(--pf-t--global--text--color--subtle); |
| 154 |
--#{$form}__field-group-header-actions--MarginInlineStart: var(--pf-t--global--spacer--sm); |
| 155 |
--#{$form}__field-group-header-actions--MarginBlockStart: calc(var(--pf-t--global--spacer--control--vertical--plain) * -1); |
| 156 |
--#{$form}__field-group-header-actions--MarginBlockEnd: calc(var(--pf-t--global--spacer--control--vertical--plain) * -1); |
| 157 |
|
| 158 |
|
| 159 |
// Field group body |
| 160 |
--#{$form}__field-group-body--PaddingBlockStart: var(--pf-t--global--spacer--lg); |
| 161 |
--#{$form}__field-group-body--PaddingBlockEnd: var(--pf-t--global--spacer--lg); |
| 162 |
--#{$form}__field-group-body--Gap: var(--#{$form}--GridGap); |
| 163 |
--#{$form}__field-group-body--GridColumn: 2 / 3; |
| 164 |
--#{$form}__field-group__field-group__field-group-body--GridColumn: 1 / 3; |
| 165 |
--#{$form}__field-group__field-group__field-group-toggle--field-group-body--GridColumn: 2 / 3; |
| 166 |
--#{$form}__field-group-body__field-group--last-child--MarginBlockEnd: calc(var(--#{$form}__field-group-body--PaddingBlockEnd) * -1); |
| 167 |
--#{$form}__field-group-body--TranslateY: 0; |
| 168 |
--#{$form}__field-group--m-expanded__field-group-body--TranslateY: 0; |
| 169 |
--#{$form}__field-group-body--TransitionDuration--expand--slide: 0s; |
| 170 |
--#{$form}__field-group-body--TransitionDuration--expand--fade: var(--pf-t--global--motion--duration--fade--default); |
| 171 |
--#{$form}__field-group-body--TransitionDuration--collapse--slide: 0s; |
| 172 |
--#{$form}__field-group-body--TransitionDuration--collapse--fade: var(--pf-t--global--motion--duration--fade--short); |
| 173 |
|
| 174 |
@media screen and (prefers-reduced-motion: no-preference) { |
| 175 |
--#{$form}__field-group-body--TransitionDuration--expand--slide: var(--pf-t--global--motion--duration--fade--default); |
| 176 |
--#{$form}__field-group-body--TransitionDuration--collapse--slide: var(--pf-t--global--motion--duration--fade--short); |
| 177 |
--#{$form}__field-group-body--TranslateY: -.5rem; |
| 178 |
} |
| 179 |
} |
| 180 |
|
| 181 |
.#{$form} { |
| 182 |
display: grid; |
| 183 |
gap: var(--#{$form}--GridGap); |
| 184 |
|
| 185 |
&.pf-m-horizontal { |
| 186 |
&.pf-m-align-right { |
| 187 |
.#{$form}__label { |
| 188 |
text-align: end; |
| 189 |
} |
| 190 |
} |
| 191 |
|
| 192 |
@include pf-v6-c-form--m-horizontal { |
| 193 |
--#{$form}__group-label--PaddingBlockEnd: 0; |
| 194 |
|
| 195 |
.#{$form}__group { |
| 196 |
display: grid; |
| 197 |
grid-template-columns: var(--#{$form}--m-horizontal__group-label--md--GridColumnWidth) var(--#{$form}--m-horizontal__group-control--md--GridColumnWidth); |
| 198 |
column-gap: var(--#{$form}--m-horizontal__group-label--md--GridColumnGap); |
| 199 |
} |
| 200 |
|
| 201 |
.#{$form}__group-label { |
| 202 |
padding-block-start: var(--#{$form}--m-horizontal__group-label--md--PaddingBlockStart); |
| 203 |
|
| 204 |
// stylelint-disable max-nesting-depth |
| 205 |
&.pf-m-no-padding-top { |
| 206 |
--#{$form}--m-horizontal__group-label--md--PaddingBlockStart: var(--#{$form}--m-horizontal__group-label--m-no-padding--md--PaddingBlockStart); |
| 207 |
|
| 208 |
transform: translateY(var(--#{$form}--m-horizontal__group-label--m-no-padding--md--TranslateY)); |
| 209 |
} |
| 210 |
|
| 211 |
&.pf-m-info { |
| 212 |
--#{$form}__group-label--m-info--Gap: var(--#{$form}--m-horizontal__group-label--m-info--Gap); |
| 213 |
|
| 214 |
flex-direction: column; |
| 215 |
align-items: flex-start; |
| 216 |
} |
| 217 |
// stylelint-enable |
| 218 |
} |
| 219 |
|
| 220 |
.#{$form}__group-label-main { |
| 221 |
flex-grow: 0; |
| 222 |
} |
| 223 |
|
| 224 |
.#{$form}__group-control { |
| 225 |
grid-column: 2; |
| 226 |
} |
| 227 |
} |
| 228 |
} |
| 229 |
|
| 230 |
&.pf-m-limit-width { |
| 231 |
max-width: var(--#{$form}--m-limit-width--MaxWidth); |
| 232 |
} |
| 233 |
} |
| 234 |
|
| 235 |
.#{$form}__group { |
| 236 |
display: flex; |
| 237 |
flex-direction: column; |
| 238 |
gap: var(--#{$form}__group--Gap); |
| 239 |
min-width: 0; |
| 240 |
|
| 241 |
&.pf-m-action { |
| 242 |
margin-block-start: var(--#{$form}__group--m-action--MarginBlockStart); |
| 243 |
overflow: hidden; // keeps the negative bottom margin bottom on .#{$form}__actions from triggering overflow |
| 244 |
} |
| 245 |
} |
| 246 |
|
| 247 |
.#{$form}__section { |
| 248 |
display: grid; |
| 249 |
gap: var(--#{$form}__section--Gap); |
| 250 |
|
| 251 |
& + .#{$form}__group:not(.pf-m-action), |
| 252 |
&:not(:first-child) { |
| 253 |
margin-block-start: var(--#{$form}__section--MarginBlockStart); |
| 254 |
} |
| 255 |
} |
| 256 |
|
| 257 |
.#{$form}__section-title { |
| 258 |
margin-block-end: var(--#{$form}__section-title--MarginBlockEnd); |
| 259 |
font-size: var(--#{$form}__section-title--FontSize); |
| 260 |
font-weight: var(--#{$form}__section-title--FontWeight); |
| 261 |
} |
| 262 |
|
| 263 |
.#{$form}__group-label { |
| 264 |
--#{$form}__helper-text--MarginBlockStart: 0; |
| 265 |
|
| 266 |
&.pf-m-info { |
| 267 |
display: flex; |
| 268 |
gap: var(--#{$form}__group-label--m-info--Gap); |
| 269 |
align-items: flex-end; |
| 270 |
} |
| 271 |
} |
| 272 |
|
| 273 |
.#{$form}__group-label-main { |
| 274 |
flex-grow: 1; |
| 275 |
} |
| 276 |
|
| 277 |
.#{$form}__group-label-info { |
| 278 |
font-size: var(--#{$form}__group-label-info--FontSize); |
| 279 |
} |
| 280 |
|
| 281 |
.#{$form}__label { |
| 282 |
font-size: var(--#{$form}__label--FontSize); |
| 283 |
line-height: var(--#{$form}__label--LineHeight); |
| 284 |
|
| 285 |
&:not(.pf-m-disabled):hover { |
| 286 |
cursor: var(--#{$form}__label--hover--Cursor); |
| 287 |
} |
| 288 |
|
| 289 |
&.pf-m-disabled { |
| 290 |
color: var(--#{$form}__label--m-disabled--Color); |
| 291 |
} |
| 292 |
|
| 293 |
&.pf-m-disabled:hover { |
| 294 |
cursor: var(--#{$form}__label--m-disabled--hover--Cursor); |
| 295 |
} |
| 296 |
} |
| 297 |
|
| 298 |
.#{$form}__label-text { |
| 299 |
font-weight: var(--#{$form}__label-text--FontWeight); |
| 300 |
} |
| 301 |
|
| 302 |
.#{$form}__label-required { |
| 303 |
margin-inline-start: var(--#{$form}__label-required--MarginInlineStart); |
| 304 |
font-size: var(--#{$form}__label-required--FontSize); |
| 305 |
color: var(--#{$form}__label-required--Color); |
| 306 |
} |
| 307 |
|
| 308 |
.#{$form}__group-label-help { |
| 309 |
.#{$button} { |
| 310 |
--#{$button}--FontSize: var(--#{$form}__group-label-help--FontSize); |
| 311 |
} |
| 312 |
} |
| 313 |
|
| 314 |
.#{$form}__group-control { |
| 315 |
min-width: 0; |
| 316 |
|
| 317 |
&.pf-m-inline { |
| 318 |
display: flex; |
| 319 |
flex-flow: row wrap; |
| 320 |
gap: var(--#{$form}__group-control--m-inline--Gap); |
| 321 |
} |
| 322 |
|
| 323 |
&.pf-m-stack { |
| 324 |
--#{$form}__helper-text--MarginBlockStart: var(--#{$form}__group-control--m-stack__helper-text--MarginBlockStart); |
| 325 |
|
| 326 |
display: grid; |
| 327 |
gap: var(--#{$form}__group-control--m-stack--Gap); |
| 328 |
} |
| 329 |
|
| 330 |
.#{$form}__helper-text:first-child { |
| 331 |
--#{$form}__helper-text--MarginBlockStart: 0; |
| 332 |
|
| 333 |
margin-block-end: var(--#{$form}__group-control__helper-text--MarginBlockEnd); |
| 334 |
} |
| 335 |
} |
| 336 |
|
| 337 |
.#{$form}__helper-text { |
| 338 |
margin-block-start: var(--#{$form}__helper-text--MarginBlockStart); |
| 339 |
|
| 340 |
&.pf-m-inactive { |
| 341 |
display: none; |
| 342 |
} |
| 343 |
|
| 344 |
&.pf-m-hidden { |
| 345 |
visibility: hidden; |
| 346 |
opacity: 0; |
| 347 |
} |
| 348 |
} |
| 349 |
|
| 350 |
// Fieldset |
| 351 |
.#{$form}__fieldset { |
| 352 |
border: 0; |
| 353 |
} |
| 354 |
|
| 355 |
.#{$form}__actions { |
| 356 |
display: flex; |
| 357 |
flex-wrap: wrap; |
| 358 |
margin-block-start: var(--#{$form}__actions--MarginBlockStart); |
| 359 |
margin-block-end: var(--#{$form}__actions--MarginBlockEnd); |
| 360 |
margin-inline-start: var(--#{$form}__actions--MarginInlineStart); |
| 361 |
margin-inline-end: var(--#{$form}__actions--MarginInlineEnd); |
| 362 |
|
| 363 |
> * { |
| 364 |
margin-block-start: var(--#{$form}__actions--child--MarginBlockStart); |
| 365 |
margin-block-end: var(--#{$form}__actions--child--MarginBlockEnd); |
| 366 |
margin-inline-start: var(--#{$form}__actions--child--MarginInlineStart); |
| 367 |
margin-inline-end: var(--#{$form}__actions--child--MarginInlineEnd); |
| 368 |
} |
| 369 |
} |
| 370 |
|
| 371 |
.#{$form}__field-group { |
| 372 |
--#{$form}__field-group--BorderBlockStartWidth: var(--#{$form}__field-group--border-width-base); |
| 373 |
|
| 374 |
display: grid; |
| 375 |
grid-template-columns: minmax(var(--#{$form}__field-group--GridTemplateColumns--toggle), max-content) 1fr; |
| 376 |
border-block-start: var(--#{$form}__field-group--BorderBlockStartWidth) solid var(--#{$form}__field-group--BorderBlockStartColor); |
| 377 |
border-block-end: var(--#{$form}__field-group--BorderBlockEndWidth) solid var(--#{$form}__field-group--BorderBlockEndColor); |
| 378 |
|
| 379 |
&:last-child { |
| 380 |
--#{$form}__field-group--BorderBlockEndWidth: 0; |
| 381 |
} |
| 382 |
|
| 383 |
& + &, |
| 384 |
&:first-child { |
| 385 |
--#{$form}__field-group--BorderBlockStartWidth: 0; |
| 386 |
} |
| 387 |
|
| 388 |
& + & { |
| 389 |
margin-block-start: var(--#{$form}__field-group--field-group--MarginBlockStart); |
| 390 |
} |
| 391 |
|
| 392 |
// nested |
| 393 |
& & { |
| 394 |
--#{$form}__field-group-body--GridColumn: var(--#{$form}__field-group__field-group__field-group-body--GridColumn); |
| 395 |
--#{$form}__field-group-toggle--PaddingBlockStart: var(--#{$form}__field-group__field-group__field-group-toggle--PaddingBlockStart); |
| 396 |
--#{$form}__field-group-header--PaddingBlockStart: var(--#{$form}__field-group__field-group__field-group-header--PaddingBlockStart); |
| 397 |
--#{$form}__field-group-header--PaddingBlockEnd: var(--#{$form}__field-group__field-group__field-group-header--PaddingBlockEnd); |
| 398 |
--#{$form}__field-group-body--PaddingBlockStart: 0; |
| 399 |
|
| 400 |
.#{$form}__field-group-toggle ~ .#{$form}__field-group-body { |
| 401 |
--#{$form}__field-group-body--GridColumn: var(--#{$form}__field-group__field-group__field-group-toggle--field-group-body--GridColumn); |
| 402 |
} |
| 403 |
} |
| 404 |
|
| 405 |
&.pf-m-expanded { |
| 406 |
> .#{$form}__field-group-toggle { |
| 407 |
--#{$form}__field-group-toggle-icon--Rotate: var(--#{$form}__field-group--m-expanded__toggle-icon--Rotate); |
| 408 |
} |
| 409 |
|
| 410 |
&.pf-m-expandable > .#{$form}__field-group-body { // TODO - remove .pf-m-expandable in a breaking change, it shouldn't be needed. Only needed now so that these styles are an opt-in behind .pf-m-expandable |
| 411 |
visibility: visible; |
| 412 |
max-height: 99999px; |
| 413 |
padding-block-start: var(--#{$form}__field-group-body--PaddingBlockStart); |
| 414 |
padding-block-end: var(--#{$form}__field-group-body--PaddingBlockEnd); |
| 415 |
opacity: 1; |
| 416 |
translate: 0 var(--#{$form}__field-group--m-expanded__field-group-body--TranslateY); |
| 417 |
transition-delay: 0s; |
| 418 |
transition-duration: var(--#{$form}__field-group-body--TransitionDuration--expand--fade), var(--#{$form}__field-group-body--TransitionDuration--expand--slide), 0s, 0s, 0s, 0s; |
| 419 |
} |
| 420 |
} |
| 421 |
} |
| 422 |
|
| 423 |
.#{$form}__field-group-toggle { |
| 424 |
grid-row: 1 / 2; |
| 425 |
grid-column: 1 / 2; |
| 426 |
padding-block-start: var(--#{$form}__field-group-toggle--PaddingBlockStart); |
| 427 |
padding-inline-end: var(--#{$form}__field-group-toggle--PaddingInlineEnd); |
| 428 |
|
| 429 |
+ .#{$form}__field-group-header { |
| 430 |
--#{$form}__field-group-header--GridColumn: var(--#{$form}__field-group-toggle--field-group-header--GridColumn); |
| 431 |
} |
| 432 |
} |
| 433 |
|
| 434 |
.#{$form}__field-group-toggle-button { |
| 435 |
margin-block-start: var(--#{$form}__field-group-toggle-button--MarginBlockStart); |
| 436 |
margin-block-end: var(--#{$form}__field-group-toggle-button--MarginBlockEnd); |
| 437 |
} |
| 438 |
|
| 439 |
.#{$form}__field-group-toggle-icon { |
| 440 |
display: inline-block; |
| 441 |
min-width: var(--#{$form}__field-group-toggle-icon--MinWidth); |
| 442 |
text-align: center; |
| 443 |
transform: rotate(var(--#{$form}__field-group-toggle-icon--Rotate)); |
| 444 |
transition-timing-function: var(--#{$form}__field-group-toggle-icon--TransitionTimingFunction); |
| 445 |
transition-duration: var(--#{$form}__field-group-toggle-icon--TransitionDuration); |
| 446 |
transition-property: transform; |
| 447 |
|
| 448 |
@include pf-v6-mirror-inline-on-rtl; |
| 449 |
} |
| 450 |
|
| 451 |
.#{$form}__field-group-header { |
| 452 |
display: flex; |
| 453 |
grid-row: 1 / 2; |
| 454 |
grid-column: var(--#{$form}__field-group-header--GridColumn); |
| 455 |
align-items: flex-start; |
| 456 |
padding-block-start: var(--#{$form}__field-group-header--PaddingBlockStart); |
| 457 |
padding-block-end: var(--#{$form}__field-group-header--PaddingBlockEnd); |
| 458 |
} |
| 459 |
|
| 460 |
.#{$form}__field-group-header-main { |
| 461 |
display: flex; |
| 462 |
flex-grow: 1; |
| 463 |
flex-direction: column; |
| 464 |
} |
| 465 |
|
| 466 |
.#{$form}__field-group-header-title { |
| 467 |
display: flex; |
| 468 |
} |
| 469 |
|
| 470 |
.#{$form}__field-group-header-title-text { |
| 471 |
flex-grow: 1; |
| 472 |
} |
| 473 |
|
| 474 |
.#{$form}__field-group-header-description { |
| 475 |
margin-block-start: var(--#{$form}__field-group-header-description--MarginBlockStart); |
| 476 |
color: var(--#{$form}__field-group-header-description--Color); |
| 477 |
} |
| 478 |
|
| 479 |
.#{$form}__field-group-header-actions { |
| 480 |
margin-block-start: var(--#{$form}__field-group-header-actions--MarginBlockStart); |
| 481 |
margin-block-end: var(--#{$form}__field-group-header-actions--MarginBlockEnd); |
| 482 |
margin-inline-start: var(--#{$form}__field-group-header-actions--MarginInlineStart); |
| 483 |
white-space: nowrap; |
| 484 |
} |
| 485 |
|
| 486 |
.#{$form}__field-group-body { |
| 487 |
display: grid; |
| 488 |
grid-column: var(--#{$form}__field-group-body--GridColumn); |
| 489 |
gap: var(--#{$form}__field-group-body--Gap); |
| 490 |
padding-block-start: var(--#{$form}__field-group-body--PaddingBlockStart); |
| 491 |
padding-block-end: var(--#{$form}__field-group-body--PaddingBlockEnd); |
| 492 |
|
| 493 |
@at-root .#{$form}__field-group.pf-m-expandable > & { |
| 494 |
visibility: hidden; |
| 495 |
max-height: 0; |
| 496 |
padding-block-start: 0; |
| 497 |
padding-block-end: 0; |
| 498 |
opacity: 0; |
| 499 |
translate: 0 var(--#{$form}__field-group-body--TranslateY); |
| 500 |
transition-delay: 0s, 0s, var(--#{$form}__field-group-body--TransitionDuration--collapse--fade), var(--#{$form}__field-group-body--TransitionDuration--collapse--fade), var(--#{$form}__field-group-body--TransitionDuration--collapse--fade), var(--#{$form}__field-group-body--TransitionDuration--collapse--fade); |
| 501 |
transition-duration: var(--#{$form}__field-group-body--TransitionDuration--collapse--fade), var(--#{$form}__field-group-body--TransitionDuration--collapse--slide), 0s, 0s, 0s, 0s; |
| 502 |
transition-property: opacity, translate, visibility, max-height, padding-block-start, padding-block-end; |
| 503 |
} |
| 504 |
|
| 505 |
> .#{$form}__field-group { |
| 506 |
&:first-child { |
| 507 |
--#{$form}__field-group-toggle--PaddingBlockStart: 0; |
| 508 |
--#{$form}__field-group-header--PaddingBlockStart: 0; |
| 509 |
} |
| 510 |
|
| 511 |
&:last-child { |
| 512 |
margin-block-end: var(--#{$form}__field-group-body__field-group--last-child--MarginBlockEnd); |
| 513 |
} |
| 514 |
} |
| 515 |
} |
| 516 |
|