Improve uses of default-themed variables

This commit is contained in:
Matthias Metelka 2022-08-30 18:54:25 +02:00
parent cb4afed825
commit 98f8ab7344
3 changed files with 5 additions and 4 deletions

View file

@ -132,7 +132,7 @@ $btn-base-color-night: fusion-vars.$button-border;
}
}
$focus-color: color(shadow-focus, default);
$focus-color: color(shadow-focus);
@function down-arrow($color) {
@return url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='transparent' stroke='#{$color}' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");

View file

@ -26,7 +26,7 @@
@return $map;
}
@function get-var-from-map($map, $keyword, $theme: default, $keys: ()) {
@function get-var-from-map($map, $keyword, $theme, $keys: ()) {
$i: str-index($keyword, "-");
@if $i {

View file

@ -51,6 +51,7 @@ $vars: (
),
button: (
focus: (
default: palette(cyan, 3),
light: palette(cyan, 2),
dark: palette(cyan, 4),
),
@ -173,12 +174,12 @@ $vars: (
),
);
@function color($keyword, $theme) {
@function color($keyword, $theme: default) {
$colors: map.get($vars, colors);
@return get-var-from-map($colors, $keyword, $theme);
}
@function prop($keyword, $theme) {
@function prop($keyword, $theme: default) {
$props: map.get($vars, props);
@return get-var-from-map($props, $keyword, $theme);
}