Я пытаюсь запустить следующий код на моем _theme.scss
$themes: (
light: (
'white': $white,
...
),
dark: (
'white': $black,
...
),
);
@mixin themify($themes){
@each $theme, $map in $themes{
.theme-#{ $theme } &{
$theme-map: () !global;
@each $key, $submap in $map{
$value: map-get(map-get($themes, $theme), '#{ $key }');
$theme-map: map-merge($theme-map, ($key: $value)) !global;
}
@content;
$theme-map: null !global;
}
}
}
@function themed($key){
@return map-get($theme-map, $key);
}
Но при компиляции я получаю следующую ошибку:
$map: null is not a map for `map-get'
Из этой строки:
@return map-get($theme-map, $key);
Я заблудился относительно того, почему это происходит.