File: spacing.scss

package info (click to toggle)
cockpit 358-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 317,272 kB
  • sloc: javascript: 775,788; python: 41,626; ansic: 33,970; cpp: 11,141; sh: 3,566; makefile: 581; xml: 262
file content (53 lines) | stat: -rw-r--r-- 1,542 bytes parent folder | download | duplicates (9)
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;