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