@apolitical/component-library 3.5.13-beta.0 → 3.5.13

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.
@@ -1,3 +1,4 @@
1
+ @use 'sass:list';
1
2
  @use 'sass:map';
2
3
 
3
4
  $breakpoint-sizes: (
@@ -10,12 +11,21 @@ $breakpoint-sizes: (
10
11
  // This mixin lets us use fast references for common breakpoints, using the map above,
11
12
  // and lets us reference custom breakpoints by passing in a number. It lets us code
12
13
  // breakpoints a bit faster by not having to type out the full media query each time.
13
- @mixin breakpoint($type, $breakpoint) {
14
- @if map-has-key($breakpoint-sizes, $breakpoint) {
15
- $breakpoint: map.get($breakpoint-sizes, $breakpoint);
14
+ @mixin breakpoint($types, $breakpoints) {
15
+ $media: ('only screen');
16
+ @for $i from 1 through length($types) {
17
+ $type: list.nth($types, $i);
18
+ $breakpoint: list.nth($breakpoints, $i);
19
+
20
+ @if map-has-key($breakpoint-sizes, list.nth($breakpoints, $i)) {
21
+ $breakpoint: map.get($breakpoint-sizes, list.nth($breakpoints, $i));
22
+ }
23
+
24
+ $query: 'and (#{$type}: #{$breakpoint}px)';
25
+ $media: list.append($media, $query, $separator: space);
16
26
  }
17
27
 
18
- @media only screen and (#{$type}: #{$breakpoint}px) {
28
+ @media #{$media} {
19
29
  @content;
20
30
  }
21
31
  }