@matteusan/himig 1.5.0 → 1.7.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.
Files changed (82) hide show
  1. package/README.md +2 -2
  2. package/_index.scss +5 -23
  3. package/ms-badge/_badge-base.scss +1 -1
  4. package/ms-badge/_badge-extend.scss +1 -1
  5. package/ms-badge/_badge-styles.scss +1 -1
  6. package/ms-button/_button-base.scss +1 -1
  7. package/ms-button/_button-extend.scss +1 -1
  8. package/ms-button/_button-mixins.scss +1 -1
  9. package/ms-button/_button-styles.scss +26 -26
  10. package/ms-card/_card-base.scss +3 -3
  11. package/ms-card/_card-extend.scss +1 -1
  12. package/ms-card/_card-styles.scss +6 -1
  13. package/ms-card/_card-theme.scss +8 -3
  14. package/ms-form-field/_form-field-base.scss +6 -2
  15. package/ms-form-field/_form-field-extend.scss +1 -1
  16. package/ms-form-field/_form-field-styles.scss +15 -11
  17. package/ms-form-field/_form-field-theme.scss +20 -8
  18. package/ms-link/_link-base.scss +1 -1
  19. package/ms-link/_link-extend.scss +1 -1
  20. package/ms-link/_link-styles.scss +1 -1
  21. package/ms-link/_link-theme.scss +4 -4
  22. package/ms-list/_list-base.scss +1 -1
  23. package/ms-list/_list-extend.scss +1 -1
  24. package/ms-list/_list-styles.scss +1 -1
  25. package/ms-select-field/_select-field-base.scss +1 -1
  26. package/ms-select-field/_select-field-extend.scss +1 -1
  27. package/ms-select-field/_select-field-styles.scss +18 -10
  28. package/ms-select-field/_select-field-theme.scss +16 -8
  29. package/ms-tick-field/_tick-field-base.scss +1 -1
  30. package/ms-tick-field/_tick-field-extend.scss +1 -1
  31. package/ms-tick-field/_tick-field-styles.scss +3 -14
  32. package/ms-tick-field/_tick-field-theme.scss +5 -0
  33. package/ms-utils/_color-utils.scss +1 -1
  34. package/ms-utils/_consts.scss +1 -1
  35. package/ms-utils/_layout-utils.scss +1 -1
  36. package/ms-utils/_struct-utils.scss +1 -1
  37. package/ms-utils/_typography-utils.scss +1 -1
  38. package/ms-utils/_util-helpers.scss +1 -1
  39. package/package.json +11 -3
  40. package/pintig/README.md +0 -2
  41. package/pintig/_index.scss +0 -77
  42. package/pintig/breakpoint/_breakpoint-sentro.scss +0 -53
  43. package/pintig/breakpoint/_index.scss +0 -23
  44. package/pintig/color/_color-constants.scss +0 -33
  45. package/pintig/color/_color-setters.scss +0 -75
  46. package/pintig/color/_color-utils.scss +0 -62
  47. package/pintig/color/_color-validators.scss +0 -59
  48. package/pintig/color/_index.scss +0 -25
  49. package/pintig/component/_component-extend.scss +0 -56
  50. package/pintig/component/_index.scss +0 -23
  51. package/pintig/component/component-base.ts +0 -81
  52. package/pintig/component/component-properties.ts +0 -25
  53. package/pintig/component/index.ts +0 -29
  54. package/pintig/component/types/ms-component.d.ts +0 -24
  55. package/pintig/index.ts +0 -29
  56. package/pintig/package.json +0 -15
  57. package/pintig/sprite/_index.scss +0 -23
  58. package/pintig/sprite/_sprite-mixins.scss +0 -29
  59. package/pintig/struct/_index.scss +0 -24
  60. package/pintig/struct/_struct-setters.scss +0 -98
  61. package/pintig/struct/_struct-utils.scss +0 -218
  62. package/pintig/struct/_struct-validators.scss +0 -57
  63. package/pintig/theme/_index.scss +0 -30
  64. package/pintig/theme/_theme-get.scss +0 -41
  65. package/pintig/theme/_theme-keys.scss +0 -43
  66. package/pintig/theme/_theme-merge.scss +0 -46
  67. package/pintig/theme/_theme-properties.scss +0 -61
  68. package/pintig/theme/_theme-setters.scss +0 -167
  69. package/pintig/theme/_theme-tokens.scss +0 -57
  70. package/pintig/tokens/_index.scss +0 -23
  71. package/pintig/tokens/_token-data.scss +0 -249
  72. package/pintig/tokens/_token-methods.scss +0 -118
  73. package/pintig/tools/_index.scss +0 -27
  74. package/pintig/tools/_tools-color.scss +0 -79
  75. package/pintig/tools/_tools-helpers.scss +0 -30
  76. package/pintig/tools/_tools-sentro.scss +0 -52
  77. package/pintig/tools/_tools-string.scss +0 -45
  78. package/pintig/tools/_tools-validation.scss +0 -71
  79. package/pintig/typography/_index.scss +0 -24
  80. package/pintig/typography/_typography-setters.scss +0 -78
  81. package/pintig/typography/_typography-utils.scss +0 -76
  82. package/pintig/typography/_typography-validators.scss +0 -47
@@ -1,249 +0,0 @@
1
- //---------------------------------------------------
2
- // Copyright (c) 2024 MatteuSan
3
- //
4
- // Permission is hereby granted, free of charge, to any person obtaining a copy
5
- // of this software and associated documentation files (the "Software"), to deal
6
- // in the Software without restriction, including without limitation the rights
7
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- // copies of the Software, and to permit persons to whom the Software is
9
- // furnished to do so, subject to the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included in all
12
- // copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- // SOFTWARE.
21
- //---------------------------------------------------
22
-
23
- @use '../tools';
24
- @use 'sass:map';
25
-
26
- $_color-tokens: (
27
- 'ms-white': (
28
- '200': #ffffff,
29
- '300': #e7e7e7,
30
- '400': #c4c4c4,
31
- '600': #b2b2b2,
32
- '800': #a1a1a1,
33
- ),
34
- 'ms-black': (
35
- '200': #252525,
36
- '300': #202020,
37
- '400': #151515,
38
- '600': #101010,
39
- '800': #000000,
40
- ),
41
- 'ms-grey': (
42
- '200': #a1a1a1,
43
- '300': #919191,
44
- '400': #717171,
45
- '600': #545454,
46
- '800': #323232,
47
- ),
48
- 'ms-dark-grey': (
49
- '200': #505050,
50
- '300': #404040,
51
- '400': #303030,
52
- '600': #202020,
53
- '800': #101010
54
- ),
55
- 'ms-red': (
56
- '200': #ff8d8d,
57
- '300': #ec4f4f,
58
- '400': #c41b1b,
59
- '600': #8d0c0c,
60
- '800': #5b0000,
61
- ),
62
- 'ms-orange': (
63
- '200': #ffaf5e,
64
- '300': #ff9346,
65
- '400': #e16c1d,
66
- '600': #af4f0b,
67
- '800': #732f00,
68
- ),
69
- 'ms-yellow': (
70
- '200': #ffc46a,
71
- '300': #fdaa31,
72
- '400': #ff9900,
73
- '600': #c97900,
74
- '800': #935800,
75
- ),
76
- 'ms-lime': (
77
- '200': #a9d37d,
78
- '300': #87cb44,
79
- '400': #63a822,
80
- '600': #468310,
81
- '800': #26480a,
82
- ),
83
- 'ms-green': (
84
- '200': #7ed38e,
85
- '300': #45ab5b,
86
- '400': #228836,
87
- '600': #1c7a2f,
88
- '800': #0c3b16,
89
- ),
90
- 'ms-aqua': (
91
- '200': #98ebef,
92
- '300': #6dd0d3,
93
- '400': #31a9ad,
94
- '600': #1b767a,
95
- '800': #0c3133,
96
- ),
97
- 'ms-blue': (
98
- '200': #98a8c4,
99
- '300': #8396b9,
100
- '400': #496c9b,
101
- '600': #12305e,
102
- '800': #030e23,
103
- ),
104
- 'ms-purple': (
105
- '200': #c0a2ee,
106
- '300': #a173e0,
107
- '400': #6c30bd,
108
- '600': #3b1570,
109
- '800': #1b0838,
110
- ),
111
- 'ms-pink': (
112
- '200': #f5a7e8,
113
- '300': #da7ac6,
114
- '400': #c727af,
115
- '600': #8f107a,
116
- '800': #49063f,
117
- ),
118
- );
119
-
120
- $_struct-tokens: (
121
- 'spacing': (
122
- 'none': 0,
123
- 'xs': tools.to-rem(4px),
124
- 'sm': tools.to-rem(8px),
125
- 'md': tools.to-rem(16px),
126
- 'lg': tools.to-rem(24px),
127
- 'xl': tools.to-rem(32px),
128
- '2xl': tools.to-rem(48px),
129
- '3xl': tools.to-rem(64px),
130
- '4xl': tools.to-rem(80px),
131
- '5xl': tools.to-rem(96px),
132
- '6xl': tools.to-rem(112px),
133
- 'auto': auto
134
- ),
135
- 'el-spacing': (
136
- 'none': 0,
137
- 'xs': 0.1rem,
138
- 'sm': 0.3rem,
139
- 'md': 0.7rem,
140
- 'lg': 1.2rem,
141
- 'xl': 2.3rem,
142
- '2xl': 3.4rem,
143
- '3xl': 4.5rem,
144
- '4xl': 6.1rem,
145
- '5xl': 8.2rem,
146
- '6xl': 12.3rem,
147
- 'auto': auto
148
- ),
149
- 'radius': (
150
- 'none': 0,
151
- 'xs': 0.1rem,
152
- 'sm': 0.3rem,
153
- 'md': 0.5rem,
154
- 'lg': 0.7rem,
155
- 'xl': 1.2rem,
156
- '2xl': 2.3rem,
157
- '3xl': 3.4rem,
158
- '4xl': 4.5rem,
159
- '5xl': 6.1rem,
160
- '6xl': 8.2rem,
161
- 'pill': 5000px,
162
- 'circle': 50%,
163
- ),
164
- 'dimension': (
165
- 'none': 0,
166
- 'xs': tools.to-rem(277px),
167
- 'sm': tools.to-rem(320px),
168
- 'md': tools.to-rem(640px),
169
- 'lg': tools.to-rem(890px),
170
- 'xl': tools.to-rem(1077px),
171
- 'sprite': tools.to-rem(32px),
172
- 'full': 100%,
173
- ),
174
- 'breakpoint': (
175
- 'none': 0,
176
- 'xs': 277px,
177
- 'sm': 320px,
178
- 'md': 640px,
179
- 'lg': 890px,
180
- 'xl': 1077px,
181
- 'sprite': 32px,
182
- ),
183
- 'border': (
184
- 'none': 0,
185
- 'xs': 1px,
186
- 'sm': 3px,
187
- 'md': 5px,
188
- 'lg': 7px,
189
- 'xl': 11px,
190
- ),
191
- 'shadow': (
192
- 'none': 0 0 0 rgba(0 0 0 / 0),
193
- 'xs': 0 0.1rem 0.3rem var(--ms-shadow-color),
194
- 'sm': 0 0.3rem 0.5rem var(--ms-shadow-color),
195
- 'md': 0 0.7rem 1.2rem var(--ms-shadow-color),
196
- 'lg': 0 1.2rem 1.5rem var(--ms-shadow-color),
197
- 'xl': 0 1.7rem 2.1rem var(--ms-shadow-color),
198
- '2xl': 0 2.3rem 3.5rem var(--ms-shadow-color),
199
- '3xl': 0 3.5rem 4.7rem var(--ms-shadow-color),
200
- '4xl': 0 4.7rem 5.2rem var(--ms-shadow-color),
201
- '5xl': 0 5.2rem 6.5rem var(--ms-shadow-color),
202
- '6xl': 0 6.7rem 7.3rem var(--ms-shadow-color),
203
- ),
204
- );
205
-
206
- $_abstracted-struct-tokens: (
207
- 'padding': map.get($_struct-tokens, 'el-spacing'),
208
- 'margin': map.get($_struct-tokens, 'spacing'),
209
- 'width': map.get($_struct-tokens, 'dimension'),
210
- 'height': map.get($_struct-tokens, 'dimension'),
211
- 'gap': map.get($_struct-tokens, 'spacing'),
212
- );
213
-
214
- $_typography-tokens: (
215
- 'family': (
216
- 'mono': ('Jetbrains Mono', monospace),
217
- 'sans-serif': ('Inter', sans-serif),
218
- 'serif': ('Noto Serif Display', serif),
219
- ),
220
- 'size': (
221
- 'xs': clamp(#{tools.to-rem(10px)}, 2vw, #{tools.to-rem(12px)}),
222
- 'sm': clamp(#{tools.to-rem(14px)}, 4vw, #{tools.to-rem(16px)}),
223
- 'md': clamp(#{tools.to-rem(17px)}, 5vw, #{tools.to-rem(21px)}),
224
- 'lg': clamp(#{tools.to-rem(19px)}, 6vw, #{tools.to-rem(25px)}),
225
- 'xl': clamp(#{tools.to-rem(24px)}, 8vw, #{tools.to-rem(30px)}),
226
- '2xl': clamp(#{tools.to-rem(26px)}, 8vw, #{tools.to-rem(36px)}),
227
- '3xl': clamp(#{tools.to-rem(32px)}, 10vw, #{tools.to-rem(42px)}),
228
- '4xl': clamp(#{tools.to-rem(39px)}, 10vw, #{tools.to-rem(49px)}),
229
- '5xl': clamp(#{tools.to-rem(47px)}, 12vw, #{tools.to-rem(57px)}),
230
- '6xl': clamp(#{tools.to-rem(56px)}, 14vw, #{tools.to-rem(66px)}),
231
- ),
232
- 'weight': (
233
- 'light': 200,
234
- 'normal': 400,
235
- 'bold': 700,
236
- 'black': 900,
237
- ),
238
- 'line-height': (
239
- 'broad': 2,
240
- 'normal': 1.5,
241
- 'condensed': 1.25,
242
- ),
243
- );
244
-
245
- $ms-tokens: map.deep-merge(
246
- $_color-tokens, map.deep-merge(
247
- $_typography-tokens, map.deep-merge($_struct-tokens, $_abstracted-struct-tokens)
248
- )
249
- );
@@ -1,118 +0,0 @@
1
- //---------------------------------------------------
2
- // Copyright (c) 2024 MatteuSan
3
- //
4
- // Permission is hereby granted, free of charge, to any person obtaining a copy
5
- // of this software and associated documentation files (the "Software"), to deal
6
- // in the Software without restriction, including without limitation the rights
7
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- // copies of the Software, and to permit persons to whom the Software is
9
- // furnished to do so, subject to the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included in all
12
- // copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- // SOFTWARE.
21
- //---------------------------------------------------
22
-
23
- @use '../tools';
24
- @use 'sass:map';
25
- @use 'sass:list';
26
- @use 'sass:string';
27
- @use 'token-data' as data;
28
-
29
- $_primitive-token-registry: ();
30
- $token-keys: map.keys(data.$ms-tokens);
31
- @each $token-key in $token-keys {
32
- $variant-keys: map.keys(map.get(data.$ms-tokens, $token-key));
33
- @each $variant-key in $variant-keys {
34
- $_primitive-token-registry: list.append($_primitive-token-registry, '#{$token-key}.#{$variant-key}') !global;
35
- }
36
- }
37
-
38
- @mixin register($map: ()) {
39
- $token-keys: map.keys($map);
40
- @each $token-key in $token-keys {
41
- $variant-keys: map.keys(map.get($map, $token-key));
42
- @each $variant-key in $variant-keys {
43
- $_primitive-token-registry: list.append($_primitive-token-registry, '#{$token-key}.#{$variant-key}') !global;
44
- }
45
- }
46
- }
47
-
48
- // TODO: Look further into this function at a later time.
49
- // @function registry-get($targets: 'all') {
50
- // @if not tools.is-empty($targets) {
51
- // $targeted-tokens: ();
52
- // @each $target in $targets {
53
- // @each $key, $value in $_primitive-token-registry {
54
- // @if string.index($key, $target) == 1 {
55
- // $targeted-tokens: map.set($targeted-tokens, $key, $value);
56
- // }
57
- // }
58
- // }
59
- // @return $targeted-tokens;
60
- // }
61
- //
62
- // @if $targets == 'all' {
63
- // @return $_primitive-token-registry;
64
- // }
65
- //
66
- // @return $_primitive-token-registry;
67
- // }
68
-
69
- /// Retrieves a token from the primitive token registry based on a given query.
70
- /// @param {PrimitiveToken} $query
71
- /// @return {*} primitive token value.
72
- @function get($query) {
73
- @if _validate($query) {
74
- $keys: tools.str-split($query, '.');
75
- $token: map.get(data.$ms-tokens, list.nth($keys, 1));
76
- $value: map.get($token, list.nth($keys, 2));
77
- @return $value;
78
- }
79
- }
80
-
81
- /// Retrieves a token from the primitive token registry based on a given query.
82
- /// @param {PrimitiveToken} $query
83
- /// @param {*} $fallback
84
- /// @return {*} primitive token value.
85
- @function switch($query, $fallback: ()) {
86
- @if check($query) == true {
87
- $keys: tools.str-split($query, '.');
88
- $token: map.get(data.$ms-tokens, list.nth($keys, 1));
89
- $value: map.get($token, list.nth($keys, 2));
90
- @return $value;
91
- }
92
- @if not tools.is-empty($fallback) {
93
- @return $fallback;
94
- }
95
- @return $query;
96
- }
97
-
98
- /// Soft validates if the query is a valid primitive token.
99
- /// @param {string} $query
100
- /// @return {boolean} true if valid, false if not.
101
- @function check($query) {
102
- @return _validate($query, $errors: false);
103
- }
104
-
105
- /// Validates if the query is a valid primitive token.
106
- /// @access private
107
- /// @param {string} $query
108
- /// @return {boolean|error} true if valid, false or an error if not.
109
- @function _validate($query, $errors: true) {
110
- @if not list.index($_primitive-token-registry, $query) {
111
- @if $errors {
112
- @error 'Invalid primitive token: #{$query}. Expecting a valid primitive token.';
113
- }
114
- @return false;
115
- }
116
-
117
- @return true;
118
- }
@@ -1,27 +0,0 @@
1
- //---------------------------------------------------
2
- // Copyright (c) 2024 MatteuSan
3
- //
4
- // Permission is hereby granted, free of charge, to any person obtaining a copy
5
- // of this software and associated documentation files (the "Software"), to deal
6
- // in the Software without restriction, including without limitation the rights
7
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- // copies of the Software, and to permit persons to whom the Software is
9
- // furnished to do so, subject to the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included in all
12
- // copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- // SOFTWARE.
21
- //---------------------------------------------------
22
-
23
- @forward 'tools-color';
24
- @forward 'tools-helpers';
25
- @forward 'tools-sentro';
26
- @forward 'tools-string' as str-*;
27
- @forward 'tools-validation';
@@ -1,79 +0,0 @@
1
- //---------------------------------------------------
2
- // Copyright (c) 2024 MatteuSan
3
- //
4
- // Permission is hereby granted, free of charge, to any person obtaining a copy
5
- // of this software and associated documentation files (the "Software"), to deal
6
- // in the Software without restriction, including without limitation the rights
7
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- // copies of the Software, and to permit persons to whom the Software is
9
- // furnished to do so, subject to the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included in all
12
- // copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- // SOFTWARE.
21
- //---------------------------------------------------
22
-
23
- @use 'tools-validation' as validator;
24
- @use 'sass:color';
25
- @use 'sass:map';
26
- @use 'sass:math';
27
-
28
- /// Tints a color from a given percentage.
29
- /// @param {color} $color
30
- /// @param {number} $percent
31
- /// @return {color} modified color.
32
- @function tint($color, $percent) {
33
- @return color.adjust(color.mix(#fff, $color, $percent), $saturation: 11%);
34
- }
35
-
36
- /// Shades a color from a given percentage.
37
- /// @param {color} $color
38
- /// @param {number} $percent
39
- /// @return {color} modified color.
40
- @function shade($color, $percent) {
41
- @return color.adjust(color.mix(#000, $color, $percent), $saturation: 11%);
42
- }
43
-
44
- @function _get-linear($color) {
45
- @if $color <= 0.4045 {
46
- @return math.div($color, 12.92);
47
- } @else {
48
- @return math.pow(math.div($color + 0.055, 1.055), 2.4);
49
- }
50
- }
51
-
52
- @function _get-luminance($color) {
53
- $r: _get-linear(math.div(color.red($color), 255));
54
- $g: _get-linear(math.div(color.green($color), 255));
55
- $b: _get-linear(math.div(color.blue($color), 255));
56
-
57
- @return (0.2126 * $r) + (0.7152 * $g) + (0.0722 * $b);
58
- }
59
-
60
- /// Gets accessible ink from a given fill.
61
- /// @param {color} $fill
62
- /// @param {boolean} $expressive
63
- /// @return {color} accessible ink color.
64
- @function get-ink($fill, $expressive: false) {
65
- $_white-lumen: _get-luminance(#fff);
66
- $_expressiveness: 87.4%;
67
-
68
- @if $expressive {
69
- @if math.abs(_get-luminance($fill) - $_white-lumen) > 0.7 {
70
- @return tint($fill, $_expressiveness);
71
- }
72
- @return shade($fill, $_expressiveness);
73
- }
74
-
75
- @if math.abs(_get-luminance($fill) - $_white-lumen) > 0.7 {
76
- @return #fff;
77
- }
78
- @return #000;
79
- }
@@ -1,30 +0,0 @@
1
- //---------------------------------------------------
2
- // Copyright (c) 2024 MatteuSan
3
- //
4
- // Permission is hereby granted, free of charge, to any person obtaining a copy
5
- // of this software and associated documentation files (the "Software"), to deal
6
- // in the Software without restriction, including without limitation the rights
7
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- // copies of the Software, and to permit persons to whom the Software is
9
- // furnished to do so, subject to the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included in all
12
- // copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- // SOFTWARE.
21
- //---------------------------------------------------
22
-
23
- @use 'tools-validation' as validators;
24
-
25
- @function prioritize($priority, $fallback) {
26
- @if validators.is-empty($priority) {
27
- @return $fallback;
28
- }
29
- @return $priority;
30
- }
@@ -1,52 +0,0 @@
1
- //---------------------------------------------------
2
- // Copyright (c) 2024 MatteuSan
3
- //
4
- // Permission is hereby granted, free of charge, to any person obtaining a copy
5
- // of this software and associated documentation files (the "Software"), to deal
6
- // in the Software without restriction, including without limitation the rights
7
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- // copies of the Software, and to permit persons to whom the Software is
9
- // furnished to do so, subject to the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included in all
12
- // copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- // SOFTWARE.
21
- //---------------------------------------------------
22
-
23
- @use 'node_modules/@matteusan/sentro';
24
-
25
- /// Converts px values to rem values.
26
- /// @param {int} $px
27
- /// @return {int} rem value.
28
- @function to-rem($px) {
29
- @return sentro.px-to-rem($px);
30
- }
31
-
32
- /// Converts rem values to px values.
33
- /// @param {int} $rem
34
- /// @return {int} px value.
35
- @function to-px($rem) {
36
- @return sentro.rem-to-px($rem);
37
- }
38
-
39
- /// Prefixes properties
40
- /// @param {string} $property
41
- /// @param {*} $value
42
- /// @return {*} generated CSS.
43
- @mixin prefix($property, $value) {
44
- @include sentro.prefix($property, $value);
45
- }
46
-
47
- /// Line clamp mixin.
48
- /// @param {string|int} $lines
49
- /// @return {*} queried line clamp styles.
50
- @mixin break($lines) {
51
- @include sentro.line-clamp($lines);
52
- }
@@ -1,45 +0,0 @@
1
- //---------------------------------------------------
2
- // Copyright (c) 2024 MatteuSan
3
- //
4
- // Permission is hereby granted, free of charge, to any person obtaining a copy
5
- // of this software and associated documentation files (the "Software"), to deal
6
- // in the Software without restriction, including without limitation the rights
7
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- // copies of the Software, and to permit persons to whom the Software is
9
- // furnished to do so, subject to the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included in all
12
- // copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- // SOFTWARE.
21
- //---------------------------------------------------
22
-
23
- @use 'sass:list';
24
- @use 'sass:string';
25
-
26
- /// Splits a string from a given separator.
27
- /// Source: https://stackoverflow.com/a/42295154
28
- /// @param {string} $string
29
- /// @param {string} $separator
30
- /// @return {list} returns split string list.
31
- @function split($string, $separator) {
32
- $split-list: ();
33
- $index: string.index($string, $separator);
34
-
35
- @while $index != null {
36
- $item: string.slice($string, 1, $index - 1);
37
- $split-list: list.append($split-list, $item, comma);
38
- $string: string.slice($string, $index + string.length($separator));
39
- $index: string.index($string, $separator);
40
- }
41
-
42
- $split-list: list.append($split-list, $string, comma);
43
-
44
- @return $split-list;
45
- }
@@ -1,71 +0,0 @@
1
- //---------------------------------------------------
2
- // Copyright (c) 2024 MatteuSan
3
- //
4
- // Permission is hereby granted, free of charge, to any person obtaining a copy
5
- // of this software and associated documentation files (the "Software"), to deal
6
- // in the Software without restriction, including without limitation the rights
7
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- // copies of the Software, and to permit persons to whom the Software is
9
- // furnished to do so, subject to the following conditions:
10
- //
11
- // The above copyright notice and this permission notice shall be included in all
12
- // copies or substantial portions of the Software.
13
- //
14
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- // SOFTWARE.
21
- //---------------------------------------------------
22
-
23
- @use 'sass:meta';
24
- @use 'sass:string';
25
-
26
- /// Public function for data type validation.
27
- /// @param {*} $query
28
- /// @param {string} $reference
29
- /// @param {boolean} $errors
30
- /// @return {boolean|error} true if matching, error/false if not.
31
- @function is-type($query, $reference, $errors: true, $custom-error: null) {
32
- @if $errors != true {
33
- @return _validate-data-type($reference, $query);
34
- } @else {
35
- @if _validate-data-type($reference, $query) == false {
36
- @if not is-empty($custom-error) {
37
- @error $custom-error;
38
- }
39
- @error 'Invalid #{string.unquote($reference)}: #{$query}! Expecting a valid #{string.unquote($reference)}.';
40
- } @else {
41
- @return true;
42
- }
43
- }
44
- }
45
-
46
- /// Checks if query is empty.
47
- /// @param {*} $query
48
- /// @return {boolean} true if empty, false if not.
49
- @function is-empty($query) {
50
- @if not $query
51
- or $query == ''
52
- or $query == ()
53
- or $query == none
54
- or $query == null
55
- or length($query) == 0 {
56
- @return true;
57
- }
58
- @return false;
59
- }
60
-
61
- /// Validates a data type on a given reference and query.
62
- /// @access private
63
- /// @param {string} $reference
64
- /// @param {*} $query
65
- /// @return {boolean} true if matching, false if not.
66
- @function _validate-data-type($reference, $query) {
67
- @if meta.type-of($query) != string.unquote($reference) {
68
- @return false;
69
- }
70
- @return true;
71
- }