forked from leafo/scssphp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.scss
More file actions
55 lines (48 loc) · 938 Bytes
/
map.scss
File metadata and controls
55 lines (48 loc) · 938 Bytes
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
49
50
51
52
53
54
55
$map: (
color: black,
color2: red,
'color' + '3': #00FF00
);
$map2: (
color: rgb(255, 255, 255),
length: 40em
);
// Map functions
div {
color: map_get($map, color);
color: map_get($map, 'color#{2}');
foo: map_values($map);
bar: map_keys($map2);
baz: map_merge($map, $map2);
foo: map_remove($map2, color);
bar: if(map_has_key($map, color), true, false);
suppress: map_get($map, null);
}
// List functions
div {
foo: nth($map, 1);
bar: nth(nth($map, 1), 1);
}
$color: ("black" : #000000);
@each $color_name, $color_value in $color {
.#{$color_name} {
background-color: $color_value !important;
}
}
$args: ('a': 1, 'b': 2);
@mixin output($args) {
@each $k, $v in $args {
#{$k}: $v;
}
}
@mixin output-varargs(
$a,
$b
) {
color: $a;
background-color: $b;
}
div {
@include output($args);
@include output-varargs($args...);
}