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