summaryrefslogtreecommitdiffstats
path: root/src/_functions.scss
blob: a11d5f4e132b7b9d67cadbb3958ef07eb7ab09f3 (plain) (blame)
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
@use 'iro-sass/src/index' as iro;

@function color($key, $tree: 'colors', $default: null, $global: false) {
    $key: iro.fn-list-prepend($key, --colors);
    @return iro.props-get($key, $tree, $default, $global);
}

@function global-color($key, $tree: 'colors', $default: null, $global: true) {
    @return color($key, $tree, $default, $global);
}

@function foreign-color($foreign-key, $key, $tree: 'colors', $default: null, $global: true) {
    $key: iro.fn-list-prepend($key, --colors);
    $key: iro.fn-list-prepend($key, $foreign-key);
    @return iro.props-get($key, $tree, $default, $global);
}

@function dim($key, $tree: 'dims', $default: null, $global: false) {
    $key: iro.fn-list-prepend($key, --dims);
    @return iro.props-get($key, $tree, $default, $global);
}

@function global-dim($key, $tree: 'dims', $default: null, $global: true) {
    @return dim($key, $tree, $default, $global);
}

@function foreign-dim($foreign-key, $key, $tree: 'dims', $default: null, $global: true) {
    $key: iro.fn-list-prepend($key, --dims);
    $key: iro.fn-list-prepend($key, $foreign-key);
    @return iro.props-get($key, $tree, $default, $global);
}