@patternfly/patternfly 4.198.0 → 4.199.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,13 +21,20 @@
21
21
  @return url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 #{$viewBox} 512'%3E%3Cpath fill='%23#{$color}' d='#{$svg-coordinates}'/%3E%3C/svg%3E");
22
22
  }
23
23
 
24
- // Return breakpoint value if it exists
24
+ // Return (width) breakpoint value if it exists
25
25
  @function pf-breakpoint-value($breakpoint, $breakpoint-map: $pf-global--breakpoint-name-map) {
26
26
  $breakpoint-value: if(map-has-key($breakpoint-map, #{$breakpoint}), map-get($breakpoint-map, #{$breakpoint}), false);
27
27
 
28
28
  @return #{$breakpoint-value};
29
29
  }
30
30
 
31
+ // Return height breakpoint value if it exists
32
+ @function pf-height-breakpoint-value($height-breakpoint, $height-breakpoint-map: $pf-global--height-breakpoint-name-map) {
33
+ $height-breakpoint-value: if(map-has-key($height-breakpoint-map, #{$height-breakpoint}), map-get($height-breakpoint-map, #{$height-breakpoint}), false);
34
+
35
+ @return #{$height-breakpoint-value};
36
+ }
37
+
31
38
  // Build breakpoint map
32
39
  // Based on $pf-global--breakpoint-name-map
33
40
  @function build-breakpoint-map($map-items...) {
@@ -57,6 +64,35 @@
57
64
  @return $map;
58
65
  }
59
66
 
67
+ // Build height breakpoint map
68
+ // Based on $pf-global--height-breakpoint-name-map
69
+ @function build-height-breakpoint-map($map-items...) {
70
+ $map: ();
71
+
72
+ @if length($map-items) == 0 {
73
+ $map: ("base": null);
74
+ $map: map-merge($map, $pf-global--height-breakpoint-name-map);
75
+ }
76
+
77
+ @else {
78
+ @each $breakpoint in $map-items {
79
+ @if not map-has-key($pf-global--height-breakpoint-name-map, $breakpoint) and $breakpoint != "base" {
80
+ $map: map-merge($map, ("invalid breakpoint #{$breakpoint}": null));
81
+ }
82
+
83
+ @else if $breakpoint == "base" {
84
+ $map: map-merge($map, ($breakpoint: null));
85
+ }
86
+
87
+ @else {
88
+ $map: map-merge($map, ($breakpoint: map-get($pf-global--height-breakpoint-name-map, #{$breakpoint})));
89
+ }
90
+ }
91
+ }
92
+
93
+ @return $map;
94
+ }
95
+
60
96
  // Build spacer map
61
97
  // Based on $pf-global--spacer-map
62
98
  @function build-spacer-map($map-items...) {
@@ -35,6 +35,43 @@
35
35
  }
36
36
  }
37
37
 
38
+ // Media query used to create responsive classes
39
+ @mixin pf-height-media-query($point) {
40
+ @if $point == "" or not $point or $point == "base" {
41
+ @content;
42
+ }
43
+
44
+ @else if $point == "sm" {
45
+ @media screen and (min-height: $pf-global--height-breakpoint--sm) {
46
+ @content;
47
+ }
48
+ }
49
+
50
+ @else if $point == "md" {
51
+ @media screen and (min-height: $pf-global--height-breakpoint--md) {
52
+ @content;
53
+ }
54
+ }
55
+
56
+ @else if $point == "lg" {
57
+ @media screen and (min-height: $pf-global--height-breakpoint--lg) {
58
+ @content;
59
+ }
60
+ }
61
+
62
+ @else if $point == "xl" {
63
+ @media screen and (min-height: $pf-global--height-breakpoint--xl) {
64
+ @content;
65
+ }
66
+ }
67
+
68
+ @else if $point == "2xl" {
69
+ @media screen and (min-height: $pf-global--height-breakpoint--2xl) {
70
+ @content;
71
+ }
72
+ }
73
+ }
74
+
38
75
  // Create single prop / value classes, optionally add responsive suffix
39
76
  // @group mixins
40
77
  // @moduleType mixin
@@ -53,13 +90,14 @@
53
90
 
54
91
  // non-responsive, base only @include pf-utility-builder($sass-map)
55
92
  // responsive, including all breakpoints @include pf-utility-builder($sass-map, $pf-global--breakpoint-list)
93
+ // responsive height breakpoints @include pf-utility-builder($sass-map, $pf-global--height-breakpoint-list, 'height')
56
94
 
57
95
  // ## Passing individual utilities values
58
96
  // ===============================================================================================
59
97
  // Example individual utility:
60
98
  // @include pf-utility-builder(flex-fill flex "1 1 auto", $pf-global--breakpoint-list);
61
99
 
62
- @mixin pf-utility-builder($props, $breakpoints: null) {
100
+ @mixin pf-utility-builder($props, $breakpoints: null, $direction: "width") {
63
101
  // if $class-name is a map
64
102
 
65
103
  // stylelint-disable
@@ -78,13 +116,27 @@
78
116
  @each $breakpoint in $breakpoints {
79
117
  $suffix: -on-#{$breakpoint};
80
118
 
81
- @include pf-media-query($breakpoint) {
82
- @each $class, $val in $props {
83
- $property: nth($val, 1);
84
- $value: #{nth($val, 2) !important};
119
+ @if $direction == 'height' {
120
+ @include pf-height-media-query($breakpoint) {
121
+ @each $class, $val in $props {
122
+ $property: nth($val, 1);
123
+ $value: #{nth($val, 2) !important};
124
+
125
+ .pf-u-#{$class}#{$suffix}-height {
126
+ #{$property}: #{$value};
127
+ }
128
+ }
129
+ }
130
+ }
131
+ @else if $direction == 'width' {
132
+ @include pf-media-query($breakpoint) {
133
+ @each $class, $val in $props {
134
+ $property: nth($val, 1);
135
+ $value: #{nth($val, 2) !important};
85
136
 
86
- .pf-u-#{$class}#{$suffix} {
87
- #{$property}: #{$value};
137
+ .pf-u-#{$class}#{$suffix} {
138
+ #{$property}: #{$value};
139
+ }
88
140
  }
89
141
  }
90
142
  }
@@ -114,6 +166,7 @@
114
166
  }
115
167
  }
116
168
  }
169
+
117
170
  // stylelint-enable
118
171
 
119
172
  @mixin pf-u-screen-reader {
@@ -198,6 +251,21 @@
198
251
  }
199
252
  }
200
253
 
254
+ // Apply height media query if value is passed
255
+ @mixin pf-apply-height-breakpoint($breakpoint) {
256
+ @if ($breakpoint == "null" or $breakpoint == "base" or $breakpoint == "") {
257
+ @content;
258
+ }
259
+
260
+ @else {
261
+ $breakpoint: pf-height-breakpoint-value($breakpoint);
262
+
263
+ @media (min-height: $breakpoint) {
264
+ @content;
265
+ }
266
+ }
267
+ }
268
+
201
269
  @mixin pf-emit-properties($map) {
202
270
  @each $prop, $value in $map {
203
271
  #{$value}: #{$prop};
@@ -167,6 +167,13 @@ $pf-global--breakpoint--lg: 992px !default;
167
167
  $pf-global--breakpoint--xl: 1200px !default;
168
168
  $pf-global--breakpoint--2xl: 1450px !default;
169
169
 
170
+ // Height breakpoints
171
+ $pf-global--height-breakpoint--sm: 0 !default;
172
+ $pf-global--height-breakpoint--md: 40rem !default; // 640px
173
+ $pf-global--height-breakpoint--lg: 48rem !default; // 768px
174
+ $pf-global--height-breakpoint--xl: 60rem !default; // 960px
175
+ $pf-global--height-breakpoint--2xl: 80rem !default; // 1280px
176
+
170
177
  // Borders
171
178
  $pf-global--BorderWidth--sm: 1px !default;
172
179
  $pf-global--BorderWidth--md: 2px !default;
@@ -285,6 +292,15 @@ $pf-global--breakpoint-name-map: (
285
292
  "2xl": $pf-global--breakpoint--2xl
286
293
  );
287
294
 
295
+ // Global breakpoint name map - used for %pf-hidden-visible
296
+ $pf-global--height-breakpoint-name-map: (
297
+ "sm": $pf-global--height-breakpoint--sm,
298
+ "md": $pf-global--height-breakpoint--md,
299
+ "lg": $pf-global--height-breakpoint--lg,
300
+ "xl": $pf-global--height-breakpoint--xl,
301
+ "2xl": $pf-global--height-breakpoint--2xl
302
+ );
303
+
288
304
  // Spacer properties
289
305
  $pf-global--spacer-properties-map: (
290
306
  "m": "margin",