| 1 |
@use '../../sass-utilities' as *; |
| 2 |
|
| 3 |
// Build spacing values |
| 4 |
// stylelint-disable |
| 5 |
@mixin pf-spacer-builder { |
| 6 |
|
| 7 |
// Loop through breakpoints |
| 8 |
@each $breakpoint, $breakpoint-value in $pf-v6-global--breakpoint-map { |
| 9 |
|
| 10 |
// Loop through margin and padding values |
| 11 |
@each $property, $property-value in $pf-v6-global--spacer-properties-map { |
| 12 |
|
| 13 |
// Loop through spacer values |
| 14 |
@each $spacer, $spacer-value in $pf-v6-global--spacer-map { |
| 15 |
|
| 16 |
// If breakpoint != null, append responsive value |
| 17 |
.#{$pf-prefix}u-#{$property}-#{$spacer}#{$breakpoint-value} { |
| 18 |
@include pf-v6-media-query($breakpoint) { |
| 19 |
$spacer-value: $spacer-value !important; |
| 20 |
|
| 21 |
// If margin x property, set left and right margins |
| 22 |
@if $property == "mx" { |
| 23 |
margin-inline: #{$spacer-value}; |
| 24 |
} |
| 25 |
|
| 26 |
// If padding x property, set left and right padding |
| 27 |
@else if $property == "my" { |
| 28 |
margin-block: #{$spacer-value}; |
| 29 |
} |
| 30 |
|
| 31 |
// If margin y property, set top and bottom margins |
| 32 |
@else if $property == "px" { |
| 33 |
padding-inline: #{$spacer-value}; |
| 34 |
} |
| 35 |
|
| 36 |
// If padding y property, set top and bottom padding |
| 37 |
@else if $property == "py" { |
| 38 |
padding-block: #{$spacer-value}; |
| 39 |
} |
| 40 |
|
| 41 |
@else { |
| 42 |
#{$property-value}: #{$spacer-value}; |
| 43 |
} |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
} |
| 48 |
} |
| 49 |
} |
| 50 |
// stylelint-enable |
| 51 |
|
| 52 |
// Build spacing values |
| 53 |
@include pf-spacer-builder; |