beathers 5.4.0 → 5.4.1

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