From 48cb00040763459fc46d4aa108bf72c12f48f422 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Fri, 21 Jun 2024 23:07:50 +0200 Subject: WIP: Refactoring --- src/objects/_palette.scss | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/objects/_palette.scss (limited to 'src/objects/_palette.scss') diff --git a/src/objects/_palette.scss b/src/objects/_palette.scss new file mode 100644 index 0000000..a86c026 --- /dev/null +++ b/src/objects/_palette.scss @@ -0,0 +1,38 @@ +@use 'sass:map'; +@use 'sass:list'; +@use 'iro-sass/src/index' as iro; +@use '../functions' as fn; +@use '../config'; + +@include iro.props-namespace('palette') { + @include iro.bem-object(iro.props-namespace()) { + display: flex; + height: 3em; + + @include iro.bem-elem('item') { + flex: 1 1 auto; + + @for $i from 1 through list.length(map.get(config.$theme-light, --grays)) { + $key: list.nth(map.keys(map.get(config.$theme-light, --grays)), $i); + + &:nth-child(#{$i}) { + background-color: fn.global-color(--base $key); + } + } + } + + @each $palette in 'blue' 'purple' 'red' 'green' 'yellow' { + @include iro.bem-modifier($palette) { + @include iro.bem-elem('item') { + @for $i from 1 through list.length(map.get(config.$theme-light, --colors)) { + $key: list.nth(map.keys(map.get(config.$theme-light, --colors)), $i); + + &:nth-child(#{$i}) { + background-color: fn.global-color(--#{$palette} $key); + } + } + } + } + } + } +} -- cgit v1.2.3-70-g09d2