summaryrefslogtreecommitdiffstats
path: root/src/objects/_palette.scss
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2024-06-22 10:39:48 +0200
committerVolpeon <git@volpeon.ink>2024-06-22 10:39:48 +0200
commit1e902449652213eb1feae5e61740cb9ce3b9d6e3 (patch)
tree1db6b07696d8f2acd138e7eed845718c1fb5237f /src/objects/_palette.scss
parentWIP: Refactoring (diff)
downloadiro-design-1e902449652213eb1feae5e61740cb9ce3b9d6e3.tar.gz
iro-design-1e902449652213eb1feae5e61740cb9ce3b9d6e3.tar.bz2
iro-design-1e902449652213eb1feae5e61740cb9ce3b9d6e3.zip
WIP: Refactoring
Diffstat (limited to 'src/objects/_palette.scss')
-rw-r--r--src/objects/_palette.scss20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/objects/_palette.scss b/src/objects/_palette.scss
index a86c026..9ecdfac 100644
--- a/src/objects/_palette.scss
+++ b/src/objects/_palette.scss
@@ -1,5 +1,6 @@
1@use 'sass:map'; 1@use 'sass:map';
2@use 'sass:list'; 2@use 'sass:list';
3@use 'sass:string';
3@use 'iro-sass/src/index' as iro; 4@use 'iro-sass/src/index' as iro;
4@use '../functions' as fn; 5@use '../functions' as fn;
5@use '../config'; 6@use '../config';
@@ -12,8 +13,11 @@
12 @include iro.bem-elem('item') { 13 @include iro.bem-elem('item') {
13 flex: 1 1 auto; 14 flex: 1 1 auto;
14 15
15 @for $i from 1 through list.length(map.get(config.$theme-light, --grays)) { 16 $palette: map.get(config.$themes, config.$theme-default, --palettes, --base);
16 $key: list.nth(map.keys(map.get(config.$theme-light, --grays)), $i); 17 $contrasts: map.get(config.$themes, config.$theme-default, --contrasts, list.nth($palette, 2));
18
19 @for $i from 1 through list.length($contrasts) {
20 $key: list.nth(map.keys($contrasts), $i);
17 21
18 &:nth-child(#{$i}) { 22 &:nth-child(#{$i}) {
19 background-color: fn.global-color(--base $key); 23 background-color: fn.global-color(--base $key);
@@ -21,14 +25,16 @@
21 } 25 }
22 } 26 }
23 27
24 @each $palette in 'blue' 'purple' 'red' 'green' 'yellow' { 28 @each $palette-name, $palette in map.get(config.$themes, config.$theme-default, --palettes) {
25 @include iro.bem-modifier($palette) { 29 $contrasts: map.get(config.$themes, config.$theme-default, --contrasts, list.nth($palette, 2));
30
31 @include iro.bem-modifier(string.slice($palette-name, 3)) {
26 @include iro.bem-elem('item') { 32 @include iro.bem-elem('item') {
27 @for $i from 1 through list.length(map.get(config.$theme-light, --colors)) { 33 @for $i from 1 through list.length($contrasts) {
28 $key: list.nth(map.keys(map.get(config.$theme-light, --colors)), $i); 34 $key: list.nth(map.keys($contrasts), $i);
29 35
30 &:nth-child(#{$i}) { 36 &:nth-child(#{$i}) {
31 background-color: fn.global-color(--#{$palette} $key); 37 background-color: fn.global-color($palette-name $key);
32 } 38 }
33 } 39 }
34 } 40 }