diff options
author | Volpeon <git@volpeon.ink> | 2024-10-17 16:45:00 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2024-10-17 16:45:00 +0200 |
commit | 50f6acc739f24bfa2ca080d08e90d82f8fa83543 (patch) | |
tree | 404dbe97d34b7e4fc3293c8e6a8c92d9941ac51e /src_old/objects/_palette.scss | |
parent | Colors (diff) | |
download | iro-design-50f6acc739f24bfa2ca080d08e90d82f8fa83543.tar.gz iro-design-50f6acc739f24bfa2ca080d08e90d82f8fa83543.tar.bz2 iro-design-50f6acc739f24bfa2ca080d08e90d82f8fa83543.zip |
Revamped variable management
Diffstat (limited to 'src_old/objects/_palette.scss')
-rw-r--r-- | src_old/objects/_palette.scss | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src_old/objects/_palette.scss b/src_old/objects/_palette.scss new file mode 100644 index 0000000..19f282f --- /dev/null +++ b/src_old/objects/_palette.scss | |||
@@ -0,0 +1,62 @@ | |||
1 | @use 'sass:map'; | ||
2 | @use 'sass:list'; | ||
3 | @use 'sass:string'; | ||
4 | @use 'iro-sass/src/index' as iro; | ||
5 | @use '../functions' as fn; | ||
6 | @use '../config'; | ||
7 | |||
8 | @include iro.props-namespace('palette') { | ||
9 | @include iro.bem-object(iro.props-namespace()) { | ||
10 | display: flex; | ||
11 | block-size: 3em; | ||
12 | |||
13 | @include iro.bem-elem('item') { | ||
14 | flex: 1 1 auto; | ||
15 | |||
16 | $palette: map.get(config.$themes, config.$theme-default, --palettes, --base); | ||
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); | ||
21 | |||
22 | &:nth-child(#{$i}) { | ||
23 | background-color: fn.global-color(--base $key); | ||
24 | } | ||
25 | } | ||
26 | } | ||
27 | |||
28 | @each $palette-name, $palette in map.get(config.$themes, config.$theme-default, --palettes) { | ||
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)) { | ||
32 | @include iro.bem-elem('item') { | ||
33 | @for $i from 1 through list.length($contrasts) { | ||
34 | $key: list.nth(map.keys($contrasts), $i); | ||
35 | |||
36 | &:nth-child(#{$i}) { | ||
37 | background-color: fn.global-color($palette-name $key); | ||
38 | } | ||
39 | } | ||
40 | } | ||
41 | } | ||
42 | } | ||
43 | |||
44 | @include iro.bem-modifier('static') { | ||
45 | @each $palette-name, $palette in map.get(config.$static-colors, --palettes) { | ||
46 | $contrasts: map.get(config.$static-colors, --contrasts); | ||
47 | |||
48 | @include iro.bem-modifier(string.slice($palette-name, 3)) { | ||
49 | @include iro.bem-elem('item') { | ||
50 | @for $i from 1 through list.length($contrasts) { | ||
51 | $key: list.nth(map.keys($contrasts), $i); | ||
52 | |||
53 | &:nth-child(#{$i}) { | ||
54 | background-color: fn.global-color(#{$palette-name}-static $key); | ||
55 | } | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | } | ||
62 | } | ||