From 98f8ab7344a43afe13261e59d625274388aa4fa0 Mon Sep 17 00:00:00 2001 From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com> Date: Tue, 30 Aug 2022 18:54:25 +0200 Subject: [PATCH] Improve uses of default-themed variables --- sass/_button-mixins.scss | 2 +- sass/_functions.scss | 2 +- sass/_vars.scss | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sass/_button-mixins.scss b/sass/_button-mixins.scss index 907a87c04..a5887188b 100644 --- a/sass/_button-mixins.scss +++ b/sass/_button-mixins.scss @@ -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"); diff --git a/sass/_functions.scss b/sass/_functions.scss index 7066d9b65..bd1affb67 100644 --- a/sass/_functions.scss +++ b/sass/_functions.scss @@ -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 { diff --git a/sass/_vars.scss b/sass/_vars.scss index f75c7fdf9..34009a1ab 100644 --- a/sass/_vars.scss +++ b/sass/_vars.scss @@ -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); }