@mlut/core 1.0.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 (84) hide show
  1. package/README.md +24 -0
  2. package/_index.scss +1 -0
  3. package/_tools.scss +1 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +2 -0
  6. package/dist/jit/JitEngine.d.ts +19 -0
  7. package/dist/jit/JitEngine.js +124 -0
  8. package/dist/jit/index.d.ts +1 -0
  9. package/dist/jit/index.js +1 -0
  10. package/dist/sass/addons/demo-theme.scss +112 -0
  11. package/dist/sass/css/_base-setup.scss +3 -0
  12. package/dist/sass/css/_index.scss +2 -0
  13. package/dist/sass/css/helpers/_index.scss +3 -0
  14. package/dist/sass/css/helpers/btn.scss +28 -0
  15. package/dist/sass/css/helpers/gs-debug.scss +28 -0
  16. package/dist/sass/css/helpers/ratio-box.scss +47 -0
  17. package/dist/sass/css/helpers/row.scss +98 -0
  18. package/dist/sass/css/helpers/wrapper.scss +21 -0
  19. package/dist/sass/css/styles/_index.scss +2 -0
  20. package/dist/sass/css/styles/generic.scss +296 -0
  21. package/dist/sass/css/styles/variables.scss +32 -0
  22. package/dist/sass/css/utils/_bg-bd.scss +27 -0
  23. package/dist/sass/css/utils/_grid.scss +37 -0
  24. package/dist/sass/css/utils/_index.scss +2 -0
  25. package/dist/sass/css/utils/_load.scss +9 -0
  26. package/dist/sass/css/utils/_transition.scss +16 -0
  27. package/dist/sass/css/utils/box-alignment.scss +29 -0
  28. package/dist/sass/css/utils/box-model.scss +48 -0
  29. package/dist/sass/css/utils/grid-system.scss +17 -0
  30. package/dist/sass/css/utils/init.scss +107 -0
  31. package/dist/sass/css/utils/other.scss +35 -0
  32. package/dist/sass/css/utils/text.scss +33 -0
  33. package/dist/sass/css/utils/visual.scss +32 -0
  34. package/dist/sass/index.scss +4 -0
  35. package/dist/sass/tools/_index.scss +4 -0
  36. package/dist/sass/tools/functions/_index.import.scss +3 -0
  37. package/dist/sass/tools/functions/_index.scss +9 -0
  38. package/dist/sass/tools/functions/base/_error.scss +9 -0
  39. package/dist/sass/tools/functions/base/_getters.scss +124 -0
  40. package/dist/sass/tools/functions/base/_index.scss +11 -0
  41. package/dist/sass/tools/functions/base/_list.scss +56 -0
  42. package/dist/sass/tools/functions/base/_math.scss +149 -0
  43. package/dist/sass/tools/functions/base/_string.scss +300 -0
  44. package/dist/sass/tools/functions/common/_custom-units.scss +231 -0
  45. package/dist/sass/tools/functions/common/_forward-tools.scss +2 -0
  46. package/dist/sass/tools/functions/common/_helpers.scss +57 -0
  47. package/dist/sass/tools/functions/common/_index.scss +9 -0
  48. package/dist/sass/tools/functions/common/_utils.scss +211 -0
  49. package/dist/sass/tools/functions/high/_at-rules.scss +296 -0
  50. package/dist/sass/tools/functions/high/_forward-tools.scss +3 -0
  51. package/dist/sass/tools/functions/high/_index.scss +8 -0
  52. package/dist/sass/tools/functions/high/utils/_index.scss +288 -0
  53. package/dist/sass/tools/functions/high/utils/_parse-util.scss +107 -0
  54. package/dist/sass/tools/functions/high/utils/_range-generators.scss +355 -0
  55. package/dist/sass/tools/functions/high/utils/_util-apply-selector.scss +134 -0
  56. package/dist/sass/tools/functions/high/utils/_value-converters.scss +294 -0
  57. package/dist/sass/tools/functions/high/utils/_value-transformers.scss +65 -0
  58. package/dist/sass/tools/mixins/_index.import.scss +2 -0
  59. package/dist/sass/tools/mixins/_index.scss +8 -0
  60. package/dist/sass/tools/mixins/base/_forward-tools.scss +2 -0
  61. package/dist/sass/tools/mixins/base/_index.scss +93 -0
  62. package/dist/sass/tools/mixins/base/_mk-ar.scss +96 -0
  63. package/dist/sass/tools/mixins/base/_mk-state.scss +175 -0
  64. package/dist/sass/tools/mixins/high/_forward-tools.scss +3 -0
  65. package/dist/sass/tools/mixins/high/_index.scss +1 -0
  66. package/dist/sass/tools/mixins/high/utils/_index.scss +188 -0
  67. package/dist/sass/tools/mixins/high/utils/_mk-util.scss +366 -0
  68. package/dist/sass/tools/settings/_index.import.scss +3 -0
  69. package/dist/sass/tools/settings/_index.scss +3 -0
  70. package/dist/sass/tools/settings/base/_general.scss +175 -0
  71. package/dist/sass/tools/settings/base/_index.scss +2 -0
  72. package/dist/sass/tools/settings/base/_utils.scss +578 -0
  73. package/dist/sass/tools/settings/common/_at-rules.scss +213 -0
  74. package/dist/sass/tools/settings/common/_index.scss +2 -0
  75. package/dist/sass/tools/settings/common/_utils.scss +1926 -0
  76. package/dist/sass/tools/settings/high/_forward-tools.scss +2 -0
  77. package/dist/sass/tools/settings/high/_grid.scss +55 -0
  78. package/dist/sass/tools/settings/high/_index.scss +2 -0
  79. package/dist/sass/tools/settings/high/_utils.scss +104 -0
  80. package/dist/utils/index.d.ts +1 -0
  81. package/dist/utils/index.js +1 -0
  82. package/dist/utils/logger.d.ts +7 -0
  83. package/dist/utils/logger.js +13 -0
  84. package/package.json +48 -0
@@ -0,0 +1,294 @@
1
+ @use 'sass:list';
2
+ @use 'sass:map';
3
+ @use 'sass:meta';
4
+ @use 'sass:math';
5
+ @use 'sass:string';
6
+
7
+ @use '../forward-tools' as ml;
8
+
9
+ // Value converters
10
+ //
11
+ // Simple converters are listed here, and more complex ones are made in separate sections on this page. Available converters:
12
+ // ```scss
13
+ //@debug ml.unitless(10); // 10
14
+ //@debug ml.resolution(2x); // 2dppx
15
+ //@debug ml.global-kw('a'); // auto
16
+ //@debug ml.abbr('bgc'); // background-color
17
+ // ```
18
+ //
19
+ // $value - value for converting
20
+ // $data = () - map with data required for converting
21
+ //
22
+ /// Styleguide: sass-tools.functions.utils.value_converters
23
+
24
+
25
+ @function convert-uv-number($value, $data: ()) {
26
+ $val-number: ml.str2n($value, true);
27
+ $units-key: map.get($data, 'units-key');
28
+
29
+ @if meta.type-of($val-number) == 'number' {
30
+ $unit-number: 0;
31
+ $unit: math.unit($val-number);
32
+
33
+ @if (
34
+ not $units-key and $unit == '' and
35
+ ($val-number - math.floor($val-number)) != 0
36
+ ) {
37
+ // TODO: add setting for changing unit
38
+ $unit-number: 1rem;
39
+ } @else {
40
+ $unit-number: map.get(
41
+ ml.$utils-cfg, 'units', $units-key or 'default', $unit
42
+ );
43
+ }
44
+
45
+ @if $unit-number {
46
+ @return math.div($val-number, map.get(ml.$units-all, $unit)) * $unit-number;
47
+ }
48
+
49
+ @if map.has-key(ml.$general-cfg, 'custom-unit-values', $unit) {
50
+ $custom-unit-value: map.get(ml.$general-cfg, 'custom-unit-values', $unit);
51
+ $custom-unit-val-type: meta.type-of($custom-unit-value);
52
+
53
+ @if $custom-unit-val-type == 'function' {
54
+ @return meta.call(
55
+ $custom-unit-value,
56
+ $val-number,
57
+ ('util': map.get($data, 'name'))
58
+ );
59
+ } @else if $custom-unit-val-type == 'number' {
60
+ @return (
61
+ math.div($val-number, map.get(ml.$units-all, $unit)) * $custom-unit-value
62
+ );
63
+ }
64
+ }
65
+
66
+ @return $val-number;
67
+ }
68
+
69
+ @if not $units-key and meta.type-of($value) == 'string' {
70
+ $fraction: ml.str-split($value, '/');
71
+
72
+ @if list.length($fraction) > 1 {
73
+ $dividend: list.nth($fraction, 1);
74
+
75
+ @if map.get($data, 'negative') {
76
+ $dividend: '-' + $dividend;
77
+ }
78
+
79
+ @return calc(
80
+ ml.apply-value-converter($dividend, 'O')
81
+ / ml.apply-value-converter(list.nth($fraction, 2), 'O')
82
+ * 100%
83
+ );
84
+ }
85
+ }
86
+
87
+ @return $value;
88
+ }
89
+
90
+ @function convert-uv-keyword($value, $data: ()) {
91
+ $name: map.get($data, 'name');
92
+ $section: map.get($data, 'section');
93
+
94
+ @if not map.has-key(ml.$utils-db, $section, 'registry', $name, 'keywords') {
95
+ @return $value;
96
+ }
97
+
98
+ @if map.has-key(
99
+ ml.$utils-db, $section, 'registry', $name, 'keywords', $value
100
+ ) {
101
+ @return map.get(
102
+ ml.$utils-db, $section, 'registry', $name, 'keywords', $value
103
+ );
104
+ }
105
+
106
+ @if map.has-key(
107
+ ml.$utils-db, $section, 'registry', $name, 'custom-keywords', $value
108
+ ) {
109
+ @return map.get(
110
+ ml.$utils-db, $section, 'registry', $name, 'custom-keywords', $value
111
+ );
112
+ }
113
+
114
+ $links: map.get(
115
+ ml.$utils-db, $section, 'registry', $name, 'keywords'
116
+ );
117
+
118
+ @each $item in $links {
119
+ @if map.has-key(ml.$utils-db, $section, 'keywords', $item, $value) {
120
+ @return map.get(ml.$utils-db, $section, 'keywords', $item, $value);
121
+ } @else if map.has-key(
122
+ ml.$utils-db, $section, 'registry', $item, 'keywords', $value
123
+ ) {
124
+ @return map.get(
125
+ ml.$utils-db, $section, 'registry', $item, 'keywords', $value
126
+ );
127
+ }
128
+ }
129
+
130
+ @return (
131
+ map.get(ml.$utils-db, 'common', 'keywords', $links, $value) or
132
+ $value
133
+ );
134
+ }
135
+
136
+ @function convert-uv-resolution($value, $data: ()) {
137
+ @return convert-uv-number(
138
+ $value, ('units-key': 'resolution')
139
+ );
140
+ }
141
+
142
+ @function convert-uv-num-percent($value, $data: ()) {
143
+ @return convert-uv-number(
144
+ $value, map.set($data, 'units-key', 'num-percent')
145
+ );
146
+ }
147
+
148
+ @function convert-uv-angle($value, $data: ()) {
149
+ @return convert-uv-number(
150
+ $value, map.set($data, 'units-key', 'angle')
151
+ );
152
+ }
153
+
154
+ @function convert-uv-num-length($value, $data: ()) {
155
+ @return convert-uv-number(
156
+ $value, map.set($data, 'units-key', 'num-length')
157
+ );
158
+ }
159
+
160
+ @function convert-uv-global-kw($value, $data: ()) {
161
+ @if map.has-key(
162
+ ml.$utils-db, 'common', 'keywords', 'css-oft', $value
163
+ ) {
164
+ @return map.get(
165
+ ml.$utils-db, 'common', 'keywords', 'css-oft', $value
166
+ );
167
+ }
168
+
169
+ @return (
170
+ map.get(ml.$utils-db, 'common', 'keywords', 'global', $value) or $value
171
+ );
172
+ }
173
+
174
+ @function convert-uv-abbr($value, $data: ()) {
175
+ @return (
176
+ ml.util-prop(
177
+ ml.str-ucfirst($value), map.get($data, 'section'), false, true
178
+ ) or
179
+ // maybe in the future, the keys of utils in the registry will be unified
180
+ ml.util-prop($value, map.get($data, 'section'), false, true) or
181
+ $value
182
+ );
183
+ }
184
+
185
+ $-tUCp-length: string.length(ml.$tUCp);
186
+
187
+ @function convert-uv-cust-prop($value, $data: ()) {
188
+ @if (
189
+ meta.type-of($value) != 'string' or
190
+ string.slice($value, 1, $-tUCp-length) != ml.$tUCp
191
+ ) {
192
+ @return $value;
193
+ }
194
+
195
+ $fallback-pos: string.index($value, ml.$tUFv);
196
+ $result: '';
197
+
198
+ // TODO: change stylelint rules to allow this code
199
+ //stylelint-disable
200
+ @if $fallback-pos {
201
+ $result: var(
202
+ #{
203
+ '--' + ml.$uv-css-var-prefix + string.slice(
204
+ $value, $-tUCp-length + 1, $fallback-pos - 1
205
+ )
206
+ },
207
+ #{
208
+ ml.apply-value-converter(
209
+ string.slice($value, $fallback-pos + 1),
210
+ map.remove($data, 'negative')...
211
+ )
212
+ }
213
+ );
214
+ } @else {
215
+ $result: var(#{
216
+ '--' + ml.$uv-css-var-prefix + string.slice(
217
+ $value, $-tUCp-length + 1
218
+ )
219
+ });
220
+ }
221
+ //stylelint-enable
222
+
223
+ @return if(
224
+ map.get($data, 'negative'),
225
+ calc($result * -1),
226
+ $result
227
+ );
228
+ }
229
+
230
+ @function convert-uv-color($value, $data: ()) {
231
+ @if map.has-key(
232
+ ml.$utils-db, 'common', 'keywords', 'colors', $value
233
+ ) {
234
+ @return map.get(
235
+ ml.$utils-db, 'common', 'keywords', 'colors', $value
236
+ );
237
+ }
238
+
239
+ @if meta.type-of($value) == 'string' {
240
+ $mod-color-list: ml.str-split($value, ml.$tUCla);
241
+
242
+ @if list.length($mod-color-list) > 1 {
243
+ //stylelint-disable
244
+ $part-color: list.nth($mod-color-list, 1);
245
+ $converted-part: ml.apply-value-converter(
246
+ $part-color, map.remove($data, 'negative')...
247
+ );
248
+ $color: ml.str-hex2color($converted-part);
249
+ //stylelint-enable
250
+
251
+ @if $color or ml.is-css-var($converted-part) {
252
+ $part-alpha: list.nth($mod-color-list, 2);
253
+ $alpha: ml.apply-value-converter($part-alpha, 'O');
254
+
255
+ @if ml.is-css-var($alpha) and not string.index($part-alpha, ml.$tUFv) {
256
+ $alpha: string.insert($alpha, ', 1', -2);
257
+ }
258
+
259
+ @return rgba($color or $converted-part, $alpha);
260
+ }
261
+ }
262
+ }
263
+
264
+ @return $value;
265
+ }
266
+
267
+ @function -is-kw-with-num($value, $str-part, $str-length: 1) {
268
+ @return (
269
+ meta.type-of($value) == 'string' and
270
+ string.slice($value, 1, $str-length) == $str-part and
271
+ ml.str-digit-index($value) == $str-length + 1
272
+ );
273
+ }
274
+
275
+ @function convert-uv-grid-tracks($value, $data: ()) {
276
+ @return if(
277
+ -is-kw-with-num($value, 't'),
278
+ repeat(
279
+ string.unquote(string.slice($value, 2)), minmax(0, 1fr)
280
+ ),
281
+ $value
282
+ );
283
+ }
284
+
285
+ @function convert-uv-grid-span($value, $data: ()) {
286
+ @if not -is-kw-with-num($value, 's') {
287
+ @return $value;
288
+ }
289
+
290
+ // string is not converted to the number because it is unlikely to use this value in the future
291
+ $number: string.unquote(string.slice($value, 2));
292
+
293
+ @return span $number / span $number;
294
+ }
@@ -0,0 +1,65 @@
1
+ @use 'sass:list';
2
+ @use 'sass:map';
3
+ @use 'sass:meta';
4
+ @use 'sass:math';
5
+ @use 'sass:string';
6
+
7
+ @use '../forward-tools' as ml;
8
+
9
+ // Value transformers
10
+ //
11
+ // Available transformers:
12
+ // ```scss
13
+ //@debug ml.transform-uv-gradiend();
14
+ // ```
15
+ //
16
+ // $value - value for transforming
17
+ // $data = () - map with data required for transforming
18
+ //
19
+ /// Styleguide: sass-tools.functions.high.utils.value_transformers
20
+
21
+ $-directions: map.values(ml.$main-directions);
22
+
23
+ @function gradient($values, $data: ()) {
24
+ $first-list: list.nth($values, 1);
25
+
26
+ @if list.index($-directions, list.nth($first-list, 1)) {
27
+ $first-list: list.join(to, $first-list);
28
+ }
29
+
30
+ @return meta.call(
31
+ // TODO: add cache with frequently used CSS functions
32
+ meta.get-function(
33
+ map.get(
34
+ ml.$utils-db, 'utils', 'registry', map.get($data, 'name'), 'css-function'
35
+ ),
36
+ true
37
+ ),
38
+ list.set-nth($values, 1, $first-list)
39
+ );
40
+ }
41
+
42
+ @function to-css-fn($values, $data: ()) {
43
+ $result: ();
44
+
45
+ @each $item in if(
46
+ list.separator($values) == comma,
47
+ $values, ($values,)
48
+ ) {
49
+ // maybe worth doing it more readable
50
+ $result: list.append(
51
+ $result,
52
+ meta.call(
53
+ meta.get-function(
54
+ map.get(
55
+ ml.$utils-db, 'utils', 'registry', map.get($data, 'name'), 'css-function'
56
+ ),
57
+ true
58
+ ),
59
+ $item
60
+ )
61
+ );
62
+ }
63
+
64
+ @return $result;
65
+ }
@@ -0,0 +1,2 @@
1
+ @forward 'base' as ml-*;
2
+ @forward 'high' as ml-*;
@@ -0,0 +1,8 @@
1
+ // Mixins
2
+ //
3
+ // Useful mixins. Most of the mixins are used for internal needs, but some can be useful in ordinary code.
4
+ //
5
+ // Styleguide: sass-tools.mixins
6
+
7
+ @forward 'base';
8
+ @forward 'high';
@@ -0,0 +1,2 @@
1
+ @forward '../../settings';
2
+ @forward '../../functions';
@@ -0,0 +1,93 @@
1
+ @use 'sass:meta';
2
+ @use 'sass:map';
3
+ @use 'sass:list';
4
+ @use 'sass:math';
5
+ @use 'sass:string';
6
+
7
+ @use 'forward-tools' as ml;
8
+
9
+ @forward 'mk-ar';
10
+ @forward 'mk-state';
11
+
12
+ // At-Rules
13
+ //
14
+ // At-Rules mixins.
15
+ //
16
+ // Styleguide: sass-tools.mixins.ar
17
+
18
+ // bp
19
+ //
20
+ // Mixin for creation media queries with breakpoints. You can use [syntax](section-concepts.html#kssref-concepts-at_rules-bp) for breakpoints from utilities or one-two arbitrary numbers. When using numbers:
21
+ // - one number: `min-width` query
22
+ // - two from zero: `max-width`
23
+ // - two numbers: range
24
+ // ```scss
25
+ // @include ml.bp('<sm,md:lg') {
26
+ // .inp--common {
27
+ // padding-left: 48px;
28
+ // }
29
+ // }
30
+ //
31
+ // @include ml.bp(0 600px) {
32
+ // .btn__icon {
33
+ // margin-left: 18px;
34
+ // }
35
+ // }
36
+ //
37
+ // @include ml.bp(16em 32em) {
38
+ // .btn__icon {
39
+ // margin-top: 8px;
40
+ // }
41
+ // }
42
+ //
43
+ // // CSS
44
+ // @media (max-width: 519px), (min-width: 768px) and (max-width: 991px) {
45
+ // .inp--common {
46
+ // padding-left: 48px;
47
+ // }
48
+ // }
49
+ //
50
+ // @media (max-width: 599px) {
51
+ // .btn__icon {
52
+ // margin-left: 18px;
53
+ // }
54
+ // }
55
+ //
56
+ // @media (min-width: 16em) and (max-width: 31.94em) {
57
+ // .btn__icon {
58
+ // margin-top: 8px;
59
+ // }
60
+ // }
61
+ // ```
62
+ //
63
+ // $bp - string in syntax for breakpoins or list with numbers.
64
+ // @content - CSS relus that will be placed into mediaquery.
65
+ //
66
+ // Styleguide: sass-tools.mixins.ar.bp
67
+
68
+ @mixin bp($bp) {
69
+ $bp-type: meta.type-of($bp);
70
+ $mq-str: '';
71
+
72
+ @if $bp-type == 'string' {
73
+ $mq-str: ml.convert-ar-bp($bp);
74
+ } @else if $bp-type == 'number' {
75
+ $mq-str: '(min-width: #{$bp})';
76
+ } @else if $bp-type == 'list' {
77
+ $from: list.nth($bp, 1);
78
+ $to: list.nth($bp, 2);
79
+ $to: $to - ml.bp-value-diff($to);
80
+
81
+ $mq-str: if(
82
+ $from == 0,
83
+ '(max-width: #{$to})',
84
+ '(min-width: #{$from}) and (max-width: #{$to})'
85
+ );
86
+ } @else {
87
+ @error 'Wrong type of argument $bp: `#{$bp-type}`. Expected `string`, `number` or numbers `list`';
88
+ }
89
+
90
+ @media #{$mq-str} {
91
+ @content;
92
+ }
93
+ }
@@ -0,0 +1,96 @@
1
+ @use 'sass:meta';
2
+ @use 'sass:map';
3
+ @use 'sass:list';
4
+ @use 'sass:string';
5
+
6
+ @use 'forward-tools' as ml;
7
+
8
+ // mk-ar
9
+ //
10
+ // Generate at-rules from the string with space separated abbreviations. Used [syntax](section-concepts.html#kssref-concepts-at_rules) for at-rules from utilities.
11
+ //
12
+ // ```scss
13
+ //@include ml.mk-ar('@s:apcr4/3@:dm') using ($ar) {
14
+ // .block {
15
+ // display: inline-grid;
16
+ // }
17
+ //}
18
+ //
19
+ //// CSS
20
+ //@supports (aspect-ratio: 4/3) {
21
+ // @media (display-mode: fullscreen) {
22
+ // .block {
23
+ // display: inline-grid;
24
+ // }
25
+ // }
26
+ //}
27
+ // ```
28
+ //
29
+ // $at-rules - string with abbreviations
30
+ // $this-util = null - utility for which the at-rules will be generated.<br> This is a map in format `('name': '', 'value': '')`
31
+ // @content - CSS rules that will be placed into at-rules
32
+ //
33
+ // Styleguide: sass-tools.mixins.ar.mk_ar
34
+
35
+ @mixin mk-ar($at-rules, $this-util: null) {
36
+ $abbr-list: ml.str-split($at-rules, ' ');
37
+
38
+ @each $key, $value in map.get(ml.$at-rules-cfg, 'keywords') {
39
+ @if meta.type-of($value) == 'string' {
40
+ $value: map.keys(map.get(ml.$at-rules-cfg, $value));
41
+ }
42
+
43
+ $abbr-list: ml.replace-keyword($abbr-list, $key, $value);
44
+ }
45
+
46
+ @each $item in $abbr-list {
47
+ $ar-list: ml.str-split($item, ml.$tAAr);
48
+
49
+ @if list.nth($ar-list, 1) == '' {
50
+ $ar-list: ml.remove-nth($ar-list, 1);
51
+ }
52
+
53
+ @include -generate-ar($item, $this-util, $ar-list, 1, list.length($ar-list)) {
54
+ @content($item);
55
+ }
56
+ }
57
+ }
58
+
59
+ @mixin -generate-ar($at-rules, $this-util, $ar-list, $cur-index, $last-index) {
60
+ $item: list.nth($ar-list, $cur-index);
61
+ $ar-alias: list.nth(ml.str-split($item, ml.$tAAnd), 1);
62
+ $ar-name: ml.ls-find(
63
+ map.keys(ml.$at-rules-db), meta.get-function('-is-ar-alias'), $ar-alias
64
+ );
65
+ $converter: null;
66
+ $ar-str: $item;
67
+
68
+ @if string.index($at-rules, ml.$tAAr) == 1 or $cur-index > 1 {
69
+ @if not $ar-name {
70
+ @error 'At-rule for alias `#{$ar-alias}` is not defined';
71
+ }
72
+
73
+ $converter: map.get(ml.$at-rules-db, $ar-name, 'converter');
74
+ $ar-str: string.slice($item, string.length($ar-alias) + 2);
75
+ } @else {
76
+ $ar-name: 'media';
77
+ $converter: meta.get-function('convert-ar-bp', false, ml);
78
+ }
79
+
80
+ @#{$ar-name} #{meta.call($converter, $ar-str, $this-util)} {
81
+ @if $cur-index < $last-index {
82
+ @include -generate-ar($at-rules, $this-util, $ar-list, $cur-index + 1, $last-index) {
83
+ @content;
84
+ }
85
+ } @else {
86
+ @content;
87
+ }
88
+ }
89
+ }
90
+
91
+ @function -is-ar-alias($name, $i, $alias) {
92
+ @return (
93
+ ($alias == '' and map.get(ml.$at-rules-db, $name, 'default')) or
94
+ map.get(ml.$at-rules-db, $name, 'alias') == $alias
95
+ );
96
+ }