@use 'sass:map'; @use './dark' as dark; @use './light' as light; $themes: (dark, light); $theme-map: ( dark-color: dark.$color, light-color: light.$color, ); @mixin themed { @each $theme in $themes { $theme-color: map.get($theme-map, #{$theme}-color) !global; :root[theme='#{$theme}'] { @content; } } } @function get-color($key) { @return map.get($theme-color, $key); }