|
| 1 | +// Sass. |
| 2 | +@use 'sass:list'; |
| 3 | + |
1 | 4 | // Modules.
|
2 |
| -@use '../list'; |
3 | 5 | @use '../map';
|
4 |
| -@use '../selector'; |
5 | 6 |
|
6 | 7 | // Functions.
|
7 |
| -@use '../color/name/name.retrieve.function' as *; |
| 8 | +@use '../color/name/name.retrieve.function' as color-name-retrieve; |
| 9 | +@use '../list/has/has.list.function' as list-has-list; |
| 10 | +@use '../list/list.nth.function' as list-nth; |
| 11 | +@use '../list/remove/remove.list.function' as list-remove-list; |
| 12 | +@use '../list/remove/remove.value.function' as list-remove-value; |
8 | 13 |
|
9 | 14 | // Status: TODO:
|
10 | 15 | // Category: Property variant
|
11 | 16 | // The `variant.create()` creates a variant built from `$value`.
|
12 | 17 | // @param `$value` A list or string type to create a variant.
|
13 | 18 | // @param `$modifier`
|
| 19 | +// @param `$type` |
14 | 20 | // @returns The returned value is a variant of map type where (class: value).
|
15 | 21 | @function create($value, $modifier: null, $type: null) {
|
16 | 22 | $result: ();
|
|
34 | 40 | $key: $value;
|
35 | 41 | @if type-of($value) == list and list.length($value) > 0 {
|
36 | 42 | // Remove !important.
|
37 |
| - $key: list.remove-value($key, !important); |
| 43 | + $key: list-remove-value.value($key, !important); |
38 | 44 |
|
39 | 45 | // FEATURE: Color variant.
|
40 | 46 | @if $type == color {
|
41 |
| - $key: map.get(retrieve($key), name); |
| 47 | + $color: color-name-retrieve.retrieve($key); |
| 48 | + $key: map.get($color, no-property-name) or map.get($color, name); |
42 | 49 | } @else {
|
43 | 50 | // FEATURE: Check key.
|
44 | 51 | @if list.separator($key) == comma {
|
45 |
| - $key: list.nth($key, 1); |
46 |
| - } @else if list.separator($key) == space and list.has-list($key) { |
47 |
| - $key: list.remove-list($key); |
| 52 | + $key: list-nth.nth($key, 1); |
| 53 | + } @else if list.separator($key) == space and list-has-list.has-list($key) { |
| 54 | + $key: list-remove-list.list($key); |
48 | 55 | }
|
49 | 56 | }
|
50 | 57 | }
|
|
0 commit comments