beathers 5.7.2 → 5.7.5

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.

Potentially problematic release.


This version of beathers might be problematic. Click here for more details.

@@ -1,136 +1,136 @@
1
- @use 'sass:map';
2
- @use 'sass:string';
3
- @use '../variables' as vars;
4
- @use '../settings/defaults' as defs;
5
- @use '../settings/index' as settings;
6
- @use '../functions/validations' as val;
7
-
8
- // Definitions
9
- $breakpoints: if(vars.$breakpoints != (), vars.$breakpoints, defs.$breakpoints);
10
-
11
- // Breakpoint Mixin
12
- // --------------------------------------
13
- // Generates a media query based on a breakpoint key and type (min/max).
14
- // If the key is not found or is null/empty (e.g., for default styles),
15
- // it applies the content directly without a media query.
16
- //
17
- // @param {String} $type - The type of media query (e.g., "min", "max").
18
- // @param {String | Null} $key - The breakpoint key from `$breakpoints` (e.g., "sm", "md", "lg").
19
- // If null or an empty string, content is applied directly.
20
- //
21
- // @content - Styles to be applied within the media query or directly.
22
- //
23
- // @example scss
24
- // .element {
25
- // color: blue; // Default
26
- //
27
- // @include mQ(min, "md") {
28
- // color: red; // Applied when (min-width: md-breakpoint-value)
29
- // }
30
- //
31
- // @include mQ(max, "lg") {
32
- // padding: 20px; // Applied when (max-width: lg-breakpoint-value)
33
- // }
34
- //
35
- // // Example for applying base styles (no media query)
36
- // @include mQ(min, null) { // or @include mQ(min, "")
37
- // font-size: 16px; // Applied directly
38
- // }
39
- // }
40
- //
41
- // @output css - Example output for .element
42
- // .element {
43
- // color: blue;
44
- // font-size: 16px;
45
- // }
46
- // @media (min-width: 768px) { // Assuming 'md' is 768px
47
- // .element {
48
- // color: red;
49
- // }
50
- // }
51
- // @media (max-width: 1024px) { // Assuming 'lg' is 1024px
52
- // .element {
53
- // padding: 20px;
54
- // }
55
- // }
56
- //
57
- @mixin mQ($type, $key, $condition: null) {
58
- // Retrieve the size value from the breakpoints map using the provided key
59
- $size: map.get($breakpoints, $key);
60
- $checkedCondition: val.boolean($condition, 'mQ().condition');
61
-
62
- @if $size and $size > 0 and $checkedCondition {
63
- // Check if a valid size value exists
64
- // Generate the media query using the provided type and size
65
- @media (string.unquote("#{$type}-width"): $size) {
66
- @content; // Content to be included within the media query
67
- }
68
- } @else {
69
- // If no valid size value exists, apply the content without a media query
70
- @content;
71
- }
72
- }
73
- // How to call
74
- // ex: color: mQ(min or max, xs/md/lg/xl/xxl) // Note: This comment seems to refer to an old way or is a general usage hint.
75
-
76
- // Multi Sizes Mixin
77
- // --------------------------------------
78
- // Iterates through media query sizes defined by the `multiSizes()` function
79
- // and applies content within the appropriate media query.
80
- // This mixin is designed to be used with `@content($size, $divider)`,
81
- // allowing the consuming code to generate responsive utility classes.
82
- //
83
- // @content {String} $size - The current breakpoint size key (e.g., "", "sm", "md").
84
- // @content {String} $divider - The class divider for the current size (e.g., "", ":").
85
- //
86
- // @example scss
87
- // // In another file (e.g., _typographic.scss)
88
- // @use "mediaQueries" as mQ;
89
- // @use "defs";
90
- //
91
- // @include mQ.multiSizes() using ($size, $divider) {
92
- // $classPrefix: if($size, "#{$size}#{$divider}", "");
93
- //
94
- // .#{$classPrefix}text-left {
95
- // text-align: left if($size, !important, null);
96
- // }
97
- // .#{$classPrefix}text-center {
98
- // text-align: center if($size, !important, null);
99
- // }
100
- // }
101
- //
102
- // @output css - Example output
103
- // .text-left {
104
- // text-align: left;
105
- // }
106
- // .text-center {
107
- // text-align: center;
108
- // }
109
- //
110
- // @media (min-width: 768px) { // Assuming 'md' is 768px
111
- // .md\\:text-left {
112
- // text-align: left !important;
113
- // }
114
- // .md\\:text-center {
115
- // text-align: center !important;
116
- // }
117
- // }
118
-
119
- @mixin multiSizes($condition: null) {
120
- $checkedCondition: val.boolean($condition, 'mQ().condition');
121
-
122
- @if $checkedCondition {
123
- @each $size, $value in $breakpoints {
124
- $divider: if($size, #{\:}, '');
125
-
126
- @include mQ(min, $size, $checkedCondition) {
127
- @content ($size, $divider);
128
- }
129
- }
130
- } @else {
131
- $size: null;
132
- $divider: '';
133
-
134
- @content ($size, $divider);
135
- }
136
- }
1
+ @use 'sass:map';
2
+ @use 'sass:string';
3
+ @use '../variables' as vars;
4
+ @use '../settings/defaults' as defs;
5
+ @use '../settings/index' as settings;
6
+ @use '../functions/validations' as val;
7
+
8
+ // Definitions
9
+ $breakpoints: if(vars.$breakpoints != (), vars.$breakpoints, defs.$breakpoints);
10
+
11
+ // Breakpoint Mixin
12
+ // --------------------------------------
13
+ // Generates a media query based on a breakpoint key and type (min/max).
14
+ // If the key is not found or is null/empty (e.g., for default styles),
15
+ // it applies the content directly without a media query.
16
+ //
17
+ // @param {String} $type - The type of media query (e.g., "min", "max").
18
+ // @param {String | Null} $key - The breakpoint key from `$breakpoints` (e.g., "sm", "md", "lg").
19
+ // If null or an empty string, content is applied directly.
20
+ //
21
+ // @content - Styles to be applied within the media query or directly.
22
+ //
23
+ // @example scss
24
+ // .element {
25
+ // color: blue; // Default
26
+ //
27
+ // @include mQ(min, "md") {
28
+ // color: red; // Applied when (min-width: md-breakpoint-value)
29
+ // }
30
+ //
31
+ // @include mQ(max, "lg") {
32
+ // padding: 20px; // Applied when (max-width: lg-breakpoint-value)
33
+ // }
34
+ //
35
+ // // Example for applying base styles (no media query)
36
+ // @include mQ(min, null) { // or @include mQ(min, "")
37
+ // font-size: 16px; // Applied directly
38
+ // }
39
+ // }
40
+ //
41
+ // @output css - Example output for .element
42
+ // .element {
43
+ // color: blue;
44
+ // font-size: 16px;
45
+ // }
46
+ // @media (min-width: 768px) { // Assuming 'md' is 768px
47
+ // .element {
48
+ // color: red;
49
+ // }
50
+ // }
51
+ // @media (max-width: 1024px) { // Assuming 'lg' is 1024px
52
+ // .element {
53
+ // padding: 20px;
54
+ // }
55
+ // }
56
+ //
57
+ @mixin mQ($type, $key, $condition: true) {
58
+ // Retrieve the size value from the breakpoints map using the provided key
59
+ $size: map.get($breakpoints, $key);
60
+ $checkedCondition: val.boolean($condition, 'mQ().condition');
61
+
62
+ @if $size and $size > 0 and $checkedCondition {
63
+ // Check if a valid size value exists
64
+ // Generate the media query using the provided type and size
65
+ @media (string.unquote("#{$type}-width"): $size) {
66
+ @content; // Content to be included within the media query
67
+ }
68
+ } @else {
69
+ // If no valid size value exists, apply the content without a media query
70
+ @content;
71
+ }
72
+ }
73
+ // How to call
74
+ // ex: color: mQ(min or max, xs/md/lg/xl/xxl) // Note: This comment seems to refer to an old way or is a general usage hint.
75
+
76
+ // Multi Sizes Mixin
77
+ // --------------------------------------
78
+ // Iterates through media query sizes defined by the `multiSizes()` function
79
+ // and applies content within the appropriate media query.
80
+ // This mixin is designed to be used with `@content($size, $divider)`,
81
+ // allowing the consuming code to generate responsive utility classes.
82
+ //
83
+ // @content {String} $size - The current breakpoint size key (e.g., "", "sm", "md").
84
+ // @content {String} $divider - The class divider for the current size (e.g., "", ":").
85
+ //
86
+ // @example scss
87
+ // // In another file (e.g., _typographic.scss)
88
+ // @use "mediaQueries" as mQ;
89
+ // @use "defs";
90
+ //
91
+ // @include mQ.multiSizes() using ($size, $divider) {
92
+ // $classPrefix: if($size, "#{$size}#{$divider}", "");
93
+ //
94
+ // .#{$classPrefix}text-left {
95
+ // text-align: left if($size, !important, null);
96
+ // }
97
+ // .#{$classPrefix}text-center {
98
+ // text-align: center if($size, !important, null);
99
+ // }
100
+ // }
101
+ //
102
+ // @output css - Example output
103
+ // .text-left {
104
+ // text-align: left;
105
+ // }
106
+ // .text-center {
107
+ // text-align: center;
108
+ // }
109
+ //
110
+ // @media (min-width: 768px) { // Assuming 'md' is 768px
111
+ // .md\\:text-left {
112
+ // text-align: left !important;
113
+ // }
114
+ // .md\\:text-center {
115
+ // text-align: center !important;
116
+ // }
117
+ // }
118
+
119
+ @mixin multiSizes($condition: null) {
120
+ $checkedCondition: val.boolean($condition, 'mQ().condition');
121
+
122
+ @if $checkedCondition {
123
+ @each $size, $value in $breakpoints {
124
+ $divider: if($size, #{\:}, '');
125
+
126
+ @include mQ(min, $size, $checkedCondition) {
127
+ @content ($size, $divider);
128
+ }
129
+ }
130
+ } @else {
131
+ $size: null;
132
+ $divider: '';
133
+
134
+ @content ($size, $divider);
135
+ }
136
+ }
@@ -1,79 +1,79 @@
1
- @use 'sass:map';
2
- @use '../variables' as vars;
3
- @use '../settings/defaults' as defs;
4
- @use '../functions/validations' as val;
5
-
6
- // Definitions
7
- $axisDivisions: if(vars.$axisDivisions != null, vars.$axisDivisions, defs.$axisDivisions);
8
-
9
- // @mixin gridDivision
10
- // @description Generates CSS grid classes for creating grid layouts.
11
- // @param {String} $axis - The grid axis ('column' or 'row').
12
- // @param {String | Null} $size - A size prefix for the generated classes (e.g., 'sm', 'md').
13
- // @param {String} $divider - A divider string for the generated classes (e.g., '-').
14
- @mixin gridDivision($axis, $size, $divider) {
15
- // Validate parameters
16
- $checkedAxis: val.listItem((column, row), $axis, 'gridDivision.axis');
17
- $checkedBase: val.number($axisDivisions, 'gridDivision.axisDivisions');
18
-
19
- $type: if($axis == 'column', 'col', 'row');
20
- $mainClass: if($size, '#{$size}#{$divider}#{$type}s', '#{$type}s');
21
- $subClass: if($size, '#{$size}#{$divider}#{$type}', $type);
22
-
23
- @for $i from 0 through $axisDivisions {
24
- @if ($i > 0) {
25
- &.#{$mainClass}#{\:}#{$i} {
26
- grid-template-#{$axis}s: repeat($i, 1fr);
27
- }
28
- }
29
-
30
- $axisProperty: if($i == 0, 'grid-#{$axis}-end', 'grid-#{$axis}');
31
- $class: if($i == 0, auto, $i);
32
- $value: if($i == 0, -1, 'span #{$i}');
33
-
34
- > .#{$subClass}#{\:}#{$class} {
35
- #{$axisProperty}: #{$value};
36
- }
37
- }
38
- }
39
-
40
- // @mixin flexDivision
41
- // @description Generates CSS flexbox classes for creating flexible layouts.
42
- // @param {String} $axis - The flex axis ('width' or 'height').
43
- // @param {String} $type - The type of flex items ('col', 'cols', 'row', 'rows').
44
- // @param {String | Null} $size - A size prefix for the generated classes (e.g., 'sm', 'md').
45
- // @param {String} $divider - A divider string for the generated classes (e.g., '-').
46
- @mixin flexDivision($axis, $type, $size, $divider) {
47
- // Validate parameters
48
- $checkedAxis: val.listItem((width, height), $axis, 'flexDivision.axis');
49
- $checkedType: val.listItem(('col', 'cols', 'rows', 'row'), $type, 'flexDivision.type');
50
- $checkedBase: val.number($axisDivisions, 'flexDivision.axisDivisions');
51
-
52
- $mainClass: if($size, '#{$size}#{$divider}#{$type}', $type);
53
-
54
- @if (not $size) and $type == 'cols' or $type == 'rows' {
55
- > * {
56
- flex: 0 0 auto;
57
- max-#{$axis}: 100%;
58
- }
59
- }
60
-
61
- @for $i from 0 through $axisDivisions {
62
- @if $type == 'cols' or $type == 'rows' {
63
- $class: if($i == 0, auto, $i);
64
- $axisSize: if($i == 0, auto, calc(100% / $i));
65
-
66
- &.#{$mainClass}#{\:}#{$class} > * {
67
- #{$axis}: if($size, $axisSize !important, $axisSize);
68
- }
69
- } @else if $type == 'col' or $type == 'row' {
70
- $axisSize: if($i == 0, 100%, calc(($i / $axisDivisions) * 100%));
71
- $class: if($i == 0, '', $i);
72
- $classSize: if($i == 0, #{$class}, #{\:}#{$class});
73
-
74
- > .#{$mainClass}#{$classSize} {
75
- #{$axis}: if($size, $axisSize !important, $axisSize);
76
- }
77
- }
78
- }
79
- }
1
+ @use 'sass:map';
2
+ @use '../variables' as vars;
3
+ @use '../settings/defaults' as defs;
4
+ @use '../functions/validations' as val;
5
+
6
+ // Definitions
7
+ $axisDivisions: if(vars.$axisDivisions != null, vars.$axisDivisions, defs.$axisDivisions);
8
+
9
+ // @mixin gridDivision
10
+ // @description Generates CSS grid classes for creating grid layouts.
11
+ // @param {String} $axis - The grid axis ('column' or 'row').
12
+ // @param {String | Null} $size - A size prefix for the generated classes (e.g., 'sm', 'md').
13
+ // @param {String} $divider - A divider string for the generated classes (e.g., '-').
14
+ @mixin gridDivision($axis, $size, $divider) {
15
+ // Validate parameters
16
+ $checkedAxis: val.listItem((column, row), $axis, 'gridDivision.axis');
17
+ $checkedBase: val.number($axisDivisions, 'gridDivision.axisDivisions');
18
+
19
+ $type: if($axis == 'column', 'col', 'row');
20
+ $mainClass: if($size, '#{$size}#{$divider}#{$type}s', '#{$type}s');
21
+ $subClass: if($size, '#{$size}#{$divider}#{$type}', $type);
22
+
23
+ @for $i from 0 through $axisDivisions {
24
+ @if ($i > 0) {
25
+ &.#{$mainClass}#{\:}#{$i} {
26
+ grid-template-#{$axis}s: repeat($i, 1fr);
27
+ }
28
+ }
29
+
30
+ $axisProperty: if($i == 0, 'grid-#{$axis}-end', 'grid-#{$axis}');
31
+ $class: if($i == 0, auto, $i);
32
+ $value: if($i == 0, -1, 'span #{$i}');
33
+
34
+ > .#{$subClass}#{\:}#{$class} {
35
+ #{$axisProperty}: #{$value};
36
+ }
37
+ }
38
+ }
39
+
40
+ // @mixin flexDivision
41
+ // @description Generates CSS flexbox classes for creating flexible layouts.
42
+ // @param {String} $axis - The flex axis ('width' or 'height').
43
+ // @param {String} $type - The type of flex items ('col', 'cols', 'row', 'rows').
44
+ // @param {String | Null} $size - A size prefix for the generated classes (e.g., 'sm', 'md').
45
+ // @param {String} $divider - A divider string for the generated classes (e.g., '-').
46
+ @mixin flexDivision($axis, $type, $size, $divider) {
47
+ // Validate parameters
48
+ $checkedAxis: val.listItem((width, height), $axis, 'flexDivision.axis');
49
+ $checkedType: val.listItem(('col', 'cols', 'rows', 'row'), $type, 'flexDivision.type');
50
+ $checkedBase: val.number($axisDivisions, 'flexDivision.axisDivisions');
51
+
52
+ $mainClass: if($size, '#{$size}#{$divider}#{$type}', $type);
53
+
54
+ @if (not $size) and $type == 'cols' or $type == 'rows' {
55
+ > * {
56
+ flex: 0 0 auto;
57
+ max-#{$axis}: 100%;
58
+ }
59
+ }
60
+
61
+ @for $i from 0 through $axisDivisions {
62
+ @if $type == 'cols' or $type == 'rows' {
63
+ $class: if($i == 0, auto, $i);
64
+ $axisSize: if($i == 0, auto, calc(100% / $i));
65
+
66
+ &.#{$mainClass}#{\:}#{$class} > * {
67
+ #{$axis}: if($size, $axisSize !important, $axisSize);
68
+ }
69
+ } @else if $type == 'col' or $type == 'row' {
70
+ $axisSize: if($i == 0, 100%, calc(($i / $axisDivisions) * 100%));
71
+ $class: if($i == 0, '', $i);
72
+ $classSize: if($i == 0, #{$class}, #{\:}#{$class});
73
+
74
+ > .#{$mainClass}#{$classSize} {
75
+ #{$axis}: if($size, $axisSize !important, $axisSize);
76
+ }
77
+ }
78
+ }
79
+ }