From 8ee5ac198ecf02cf4d7f4f60f1d2b82a09ce002a Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Fri, 30 Jul 2021 13:13:12 +0200 Subject: [PATCH] fix: optimize palette --- src/scss/definitions/_palette.scss | 32 +++++++++++++++++------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/scss/definitions/_palette.scss b/src/scss/definitions/_palette.scss index 59e23e8..09869c8 100644 --- a/src/scss/definitions/_palette.scss +++ b/src/scss/definitions/_palette.scss @@ -25,19 +25,9 @@ $palette: ( "yellow":#b58900, "grey":#586e75, "dark2":#073642, - "light2":#eee8d5, - "gray2":#657b83, - "gray3":#839496, - "gray4":#93a1a1); + "light2":#eee8d5); $semantics: ( - "font":"dark2", - "font-light":"light", - "background":"light", - "background-alt":"light2", - "link":"skyblue", - "selection":"skyblue", - "mark":"yellow", "primary":"violet", "secondary":"skyblue", "warning":"orange", @@ -46,11 +36,25 @@ $semantics: ( "success":"green", "muted":"grey"); +$helpers: ( + "font":"dark2", + "font-light":"light", + "background":"light", + "background-alt":"light2", + "link":"skyblue", + "selection":"skyblue", + "mark":"yellow", +); + @function get-color($name) { - @if map-has-key($semantics, $name) { - @return map-get($palette, map-get($semantics, $name)); + @if map-has-key($helpers, $name) { + @return map-get($palette, map-get($helpers, $name)); } @else { - @return map-get($palette, $name); + @if map-has-key($semantics, $name) { + @return map-get($palette, map-get($semantics, $name)); + } @else { + @return map-get($palette, $name); + } } }