-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_update.property.function.scss
48 lines (45 loc) · 1.75 KB
/
_update.property.function.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Sass.
@use 'sass:list';
// Modules.
@use '../../map';
@use '../../values';
// Property.
// pre-base, base, middle, attribute, (additional) attribute
// -, border, start start, radius
// Status: TODO:
// The `update.property()` function.
// @param `$property`
// @param `$modifier`
// @param `$attribute`
// @param `$level`
// @returns
@function property($property, $modifier, $attribute: null, $level: null) {
@if list.separator($property) == comma {
$i: 1;
@each $base in $property {
$property: list.set-nth(
$property,
$i,
values.join(
(separator: space),
map.get-any($modifier, ($level, property, pre-base), (property, pre-base), ($level, property, prefix), (property, prefix), null),
map.get-any($modifier, ($level, property, base), (property, base), ($level, property, name), (property, name), null) or $base,
map.get-any($modifier, ($level, property, middle), (property, middle), null),
$attribute,
map.get-any($modifier, ($level, property, attribute), (property, attribute), ($level, property, end), (property, end), null),
)
);
$i: $i + 1;
}
} @else {
$property: values.join(
(separator: space),
map.get-any($modifier, ($level, property, pre-base), (property, pre-base), ($level, property, prefix), (property, prefix), null),
map.get-any($modifier, ($level, property, base), (property, base), ($level, property, name), (property, name), null) or $property,
map.get-any($modifier, ($level, property, middle), (property, middle), null),
$attribute,
map.get-any($modifier, ($level, property, attribute), (property, attribute), ($level, property, end), (property, end), null),
);
}
@return $property;
}