summaryrefslogtreecommitdiffstats
path: root/src/objects
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2024-10-18 19:07:42 +0200
committerVolpeon <git@volpeon.ink>2024-10-18 19:07:42 +0200
commite3d34a6d6ce2db04c3c898ad6a4687a0c59df996 (patch)
tree58b338d738076579030624b563df2365af19782e /src/objects
parentRefactoring (diff)
downloadiro-design-e3d34a6d6ce2db04c3c898ad6a4687a0c59df996.tar.gz
iro-design-e3d34a6d6ce2db04c3c898ad6a4687a0c59df996.tar.bz2
iro-design-e3d34a6d6ce2db04c3c898ad6a4687a0c59df996.zip
Update
Diffstat (limited to 'src/objects')
-rw-r--r--src/objects/_action-button.vars.scss188
-rw-r--r--src/objects/_alert.scss50
-rw-r--r--src/objects/_alert.vars.scss26
-rw-r--r--src/objects/_avatar.scss131
-rw-r--r--src/objects/_avatar.vars.scss52
-rw-r--r--src/objects/_heading.scss8
6 files changed, 234 insertions, 221 deletions
diff --git a/src/objects/_action-button.vars.scss b/src/objects/_action-button.vars.scss
index 16d9e7f..d1b3a4a 100644
--- a/src/objects/_action-button.vars.scss
+++ b/src/objects/_action-button.vars.scss
@@ -1,33 +1,33 @@
1@use 'sass:map'; 1@use 'sass:map';
2@use '../props'; 2@use '../props';
3@use '../vars'; 3@use '../core';
4 4
5$line-height: props.def(--o-action-button--line-height, 1.4) !default; 5$line-height: props.def(--o-action-button--line-height, 1.4) !default;
6$pad-i: props.def(--o-action-button--pad-i, props.get(vars.$size--150)) !default; 6$pad-i: props.def(--o-action-button--pad-i, props.get(core.$size--150)) !default;
7$pad-i-pill: props.def(--o-action-button--pad-i-pill, props.get(vars.$size--200)) !default; 7$pad-i-pill: props.def(--o-action-button--pad-i-pill, props.get(core.$size--200)) !default;
8$pad-b: props.def(--o-action-button--pad-b, props.get(vars.$size--85)) !default; 8$pad-b: props.def(--o-action-button--pad-b, props.get(core.$size--85)) !default;
9$border-width: props.def(--o-action-button--border-width, props.get(vars.$border-width--thin)) !default; 9$border-width: props.def(--o-action-button--border-width, props.get(core.$border-width--thin)) !default;
10$rounding: props.def(--o-action-button--rounding, props.get(vars.$rounding)) !default; 10$rounding: props.def(--o-action-button--rounding, props.get(core.$rounding)) !default;
11$font-size: props.def(--o-action-button--font-size, props.get(vars.$font-size--100)) !default; 11$font-size: props.def(--o-action-button--font-size, props.get(core.$font-size--100)) !default;
12 12
13$pad-i--sm: props.def(--o-action-button--pad-i, props.get(vars.$size--100), 'sm') !default; 13$pad-i--sm: props.def(--o-action-button--pad-i, props.get(core.$size--100), 'sm') !default;
14$pad-i-pill--sm: props.def(--o-action-button--pad-i-pill, props.get(vars.$size--150), 'sm') !default; 14$pad-i-pill--sm: props.def(--o-action-button--pad-i-pill, props.get(core.$size--150), 'sm') !default;
15$pad-b--sm: props.def(--o-action-button--pad-b, props.get(vars.$size--40), 'sm') !default; 15$pad-b--sm: props.def(--o-action-button--pad-b, props.get(core.$size--40), 'sm') !default;
16$font-size--sm: props.def(--o-action-button--font-size, props.get(vars.$font-size--75), 'sm') !default; 16$font-size--sm: props.def(--o-action-button--font-size, props.get(core.$font-size--75), 'sm') !default;
17 17
18$pad-i--lg: props.def(--o-action-button--pad-i, props.get(vars.$size--175), 'lg') !default; 18$pad-i--lg: props.def(--o-action-button--pad-i, props.get(core.$size--175), 'lg') !default;
19$pad-i-pill--lg: props.def(--o-action-button--pad-i-pill, props.get(vars.$size--225), 'lg') !default; 19$pad-i-pill--lg: props.def(--o-action-button--pad-i-pill, props.get(core.$size--225), 'lg') !default;
20$pad-b--lg: props.def(--o-action-button--pad-b, props.get(vars.$size--115), 'lg') !default; 20$pad-b--lg: props.def(--o-action-button--pad-b, props.get(core.$size--115), 'lg') !default;
21$font-size--lg: props.def(--o-action-button--font-size, props.get(vars.$font-size--150), 'lg') !default; 21$font-size--lg: props.def(--o-action-button--font-size, props.get(core.$font-size--150), 'lg') !default;
22 22
23$pad-i--xl: props.def(--o-action-button--pad-i, props.get(vars.$size--225), 'xl') !default; 23$pad-i--xl: props.def(--o-action-button--pad-i, props.get(core.$size--225), 'xl') !default;
24$pad-i-pill--xl: props.def(--o-action-button--pad-i-pill, props.get(vars.$size--300), 'xl') !default; 24$pad-i-pill--xl: props.def(--o-action-button--pad-i-pill, props.get(core.$size--300), 'xl') !default;
25$pad-b--xl: props.def(--o-action-button--pad-b, props.get(vars.$size--150), 'xl') !default; 25$pad-b--xl: props.def(--o-action-button--pad-b, props.get(core.$size--150), 'xl') !default;
26$font-size--xl: props.def(--o-action-button--font-size, props.get(vars.$font-size--200), 'xl') !default; 26$font-size--xl: props.def(--o-action-button--font-size, props.get(core.$font-size--200), 'xl') !default;
27 27
28$key-focus--border-width: props.def(--o-action-button--key-focus--border-width, props.get(vars.$key-focus--border-width)) !default; 28$key-focus--border-width: props.def(--o-action-button--key-focus--border-width, props.get(core.$key-focus--border-width)) !default;
29$key-focus--border-offset: props.def(--o-action-button--key-focus--border-offset, props.get(vars.$key-focus--border-offset)) !default; 29$key-focus--border-offset: props.def(--o-action-button--key-focus--border-offset, props.get(core.$key-focus--border-offset)) !default;
30$key-focus--outline-width: props.def(--o-action-button--key-focus--outline-width, props.get(vars.$key-focus--outline-width)) !default; 30$key-focus--outline-width: props.def(--o-action-button--key-focus--outline-width, props.get(core.$key-focus--outline-width)) !default;
31 31
32$fixed-sizes: ( 32$fixed-sizes: (
33 'sm' $pad-i--sm $pad-i-pill--sm $pad-b--sm $font-size--sm, 33 'sm' $pad-i--sm $pad-i-pill--sm $pad-b--sm $font-size--sm,
@@ -35,149 +35,151 @@ $fixed-sizes: (
35 'xl' $pad-i--xl $pad-i-pill--xl $pad-b--xl $font-size--xl, 35 'xl' $pad-i--xl $pad-i-pill--xl $pad-b--xl $font-size--xl,
36) !default; 36) !default;
37 37
38$default-theme: props.def(--o-action-button, ( 38$default-theme-override: () !default;
39 --bg-color: props.get(vars.$theme, --base, --75), 39$default-theme: map.deep-merge((
40 --label-color: props.get(vars.$theme, --text), 40 --bg-color: props.get(core.$theme, --base, --75),
41 --border-color: props.get(vars.$theme, --border-strong), 41 --label-color: props.get(core.$theme, --text),
42 --border-color: props.get(core.$theme, --border-strong),
42 43
43 --hover: ( 44 --hover: (
44 --bg-color: props.get(vars.$theme, --border-mute), 45 --bg-color: props.get(core.$theme, --border-mute),
45 --label-color: props.get(vars.$theme, --heading), 46 --label-color: props.get(core.$theme, --heading),
46 --border-color: props.get(vars.$theme, --text-mute-more), 47 --border-color: props.get(core.$theme, --text-mute-more),
47 ), 48 ),
48 49
49 --active: ( 50 --active: (
50 --bg-color: props.get(vars.$theme, --border), 51 --bg-color: props.get(core.$theme, --border),
51 --label-color: props.get(vars.$theme, --heading), 52 --label-color: props.get(core.$theme, --heading),
52 --border-color: props.get(vars.$theme, --text-mute), 53 --border-color: props.get(core.$theme, --text-mute),
53 ), 54 ),
54 55
55 --disabled: ( 56 --disabled: (
56 --bg-color: props.get(vars.$theme, --bg-l1), 57 --bg-color: props.get(core.$theme, --bg-l1),
57 --label-color: props.get(vars.$theme, --border-strong), 58 --label-color: props.get(core.$theme, --border-strong),
58 --border-color: props.get(vars.$theme, --border), 59 --border-color: props.get(core.$theme, --border),
59 ), 60 ),
60 61
61 --key-focus: ( 62 --key-focus: (
62 --border-color: props.get(vars.$theme, --focus, --border), 63 --border-color: props.get(core.$theme, --focus, --border),
63 --outline-color: props.get(vars.$theme, --focus, --outline), 64 --outline-color: props.get(core.$theme, --focus, --outline),
64 ), 65 ),
65 66
66 --selected: ( 67 --selected: (
67 --bg-color: props.get(vars.$theme, --text-mute), 68 --bg-color: props.get(core.$theme, --text-mute),
68 --label-color: props.get(vars.$theme, --base, --50), 69 --label-color: props.get(core.$theme, --base, --50),
69 --border-color: props.get(vars.$theme, --text-mute), 70 --border-color: props.get(core.$theme, --text-mute),
70 71
71 --hover: ( 72 --hover: (
72 --bg-color: props.get(vars.$theme, --text), 73 --bg-color: props.get(core.$theme, --text),
73 --label-color: props.get(vars.$theme, --base, --50), 74 --label-color: props.get(core.$theme, --base, --50),
74 --border-color: props.get(vars.$theme, --text), 75 --border-color: props.get(core.$theme, --text),
75 ), 76 ),
76 77
77 --active: ( 78 --active: (
78 --bg-color: props.get(vars.$theme, --heading), 79 --bg-color: props.get(core.$theme, --heading),
79 --label-color: props.get(vars.$theme, --base, --50), 80 --label-color: props.get(core.$theme, --base, --50),
80 --border-color: props.get(vars.$theme, --heading), 81 --border-color: props.get(core.$theme, --heading),
81 ), 82 ),
82 83
83 --disabled: ( 84 --disabled: (
84 --bg-color: props.get(vars.$theme, --border-mute), 85 --bg-color: props.get(core.$theme, --border-mute),
85 --label-color: props.get(vars.$theme, --border-strong), 86 --label-color: props.get(core.$theme, --border-strong),
86 --border-color: props.get(vars.$theme, --border-mute), 87 --border-color: props.get(core.$theme, --border-mute),
87 ), 88 ),
88 ), 89 ),
89 90
90 --quiet: ( 91 --quiet: (
91 --label-color: props.get(vars.$theme, --text), 92 --label-color: props.get(core.$theme, --text),
92 93
93 --hover: ( 94 --hover: (
94 --bg-color: props.get(vars.$theme, --border-mute), 95 --bg-color: props.get(core.$theme, --border-mute),
95 --label-color: props.get(vars.$theme, --heading), 96 --label-color: props.get(core.$theme, --heading),
96 ), 97 ),
97 98
98 --active: ( 99 --active: (
99 --bg-color: props.get(vars.$theme, --border), 100 --bg-color: props.get(core.$theme, --border),
100 --label-color: props.get(vars.$theme, --heading), 101 --label-color: props.get(core.$theme, --heading),
101 ), 102 ),
102 103
103 --disabled: ( 104 --disabled: (
104 --label-color: props.get(vars.$theme, --border-strong), 105 --label-color: props.get(core.$theme, --border-strong),
105 ), 106 ),
106 ), 107 ),
107)) !default; 108), $default-theme-override) !default;
109$default-theme: props.def(--o-action-button, $default-theme);
108 110
109$static-themes: props.def(--o-action-button); 111$static-themes: props.def(--o-action-button);
110@each $theme in map.keys(props.get(vars.$transparent-colors)) { 112@each $theme in map.keys(props.get(core.$transparent-colors)) {
111 $button-theme: #{$theme}-static; 113 $button-theme: #{$theme}-static;
112 114
113 $static-themes: props.merge($static-themes, ( 115 $static-themes: props.merge($static-themes, (
114 $button-theme: ( 116 $button-theme: (
115 --bg-color: props.get(vars.$transparent-colors, $theme, --100), 117 --bg-color: props.get(core.$transparent-colors, $theme, --100),
116 --label-color: props.get(vars.$transparent-colors, $theme, --900), 118 --label-color: props.get(core.$transparent-colors, $theme, --900),
117 --border-color: props.get(vars.$transparent-colors, $theme, --400), 119 --border-color: props.get(core.$transparent-colors, $theme, --400),
118 120
119 --hover: ( 121 --hover: (
120 --bg-color: props.get(vars.$transparent-colors, $theme, --300), 122 --bg-color: props.get(core.$transparent-colors, $theme, --300),
121 --label-color: props.get(vars.$transparent-colors, $theme, --900), 123 --label-color: props.get(core.$transparent-colors, $theme, --900),
122 --border-color: props.get(vars.$transparent-colors, $theme, --500), 124 --border-color: props.get(core.$transparent-colors, $theme, --500),
123 ), 125 ),
124 126
125 --active: ( 127 --active: (
126 --bg-color: props.get(vars.$transparent-colors, $theme, --400), 128 --bg-color: props.get(core.$transparent-colors, $theme, --400),
127 --label-color: props.get(vars.$transparent-colors, $theme, --900), 129 --label-color: props.get(core.$transparent-colors, $theme, --900),
128 --border-color: props.get(vars.$transparent-colors, $theme, --600), 130 --border-color: props.get(core.$transparent-colors, $theme, --600),
129 ), 131 ),
130 132
131 --disabled: ( 133 --disabled: (
132 --bg-color: props.get(vars.$transparent-colors, $theme, --100), 134 --bg-color: props.get(core.$transparent-colors, $theme, --100),
133 --label-color: props.get(vars.$transparent-colors, $theme, --500), 135 --label-color: props.get(core.$transparent-colors, $theme, --500),
134 --border-color: props.get(vars.$transparent-colors, $theme, --300), 136 --border-color: props.get(core.$transparent-colors, $theme, --300),
135 ), 137 ),
136 138
137 --key-focus: ( 139 --key-focus: (
138 --border-color: props.get(vars.$transparent-colors, $theme, --900), 140 --border-color: props.get(core.$transparent-colors, $theme, --900),
139 --outline-color: props.get(vars.$transparent-colors, $theme, --300), 141 --outline-color: props.get(core.$transparent-colors, $theme, --300),
140 ), 142 ),
141 143
142 --selected: ( 144 --selected: (
143 --bg-color: props.get(vars.$transparent-colors, $theme, --800), 145 --bg-color: props.get(core.$transparent-colors, $theme, --800),
144 --label-color: props.get(vars.$transparent-colors, $theme, --text), 146 --label-color: props.get(core.$transparent-colors, $theme, --text),
145 --border-color: props.get(vars.$transparent-colors, $theme, --100), 147 --border-color: props.get(core.$transparent-colors, $theme, --100),
146 148
147 --hover: ( 149 --hover: (
148 --bg-color: props.get(vars.$transparent-colors, $theme, --900), 150 --bg-color: props.get(core.$transparent-colors, $theme, --900),
149 --label-color: props.get(vars.$transparent-colors, $theme, --text), 151 --label-color: props.get(core.$transparent-colors, $theme, --text),
150 --border-color: props.get(vars.$transparent-colors, $theme, --100), 152 --border-color: props.get(core.$transparent-colors, $theme, --100),
151 ), 153 ),
152 154
153 --active: ( 155 --active: (
154 --bg-color: props.get(vars.$transparent-colors, $theme, --900), 156 --bg-color: props.get(core.$transparent-colors, $theme, --900),
155 --label-color: props.get(vars.$transparent-colors, $theme, --text), 157 --label-color: props.get(core.$transparent-colors, $theme, --text),
156 --border-color: props.get(vars.$transparent-colors, $theme, --100), 158 --border-color: props.get(core.$transparent-colors, $theme, --100),
157 ), 159 ),
158 160
159 --disabled: ( 161 --disabled: (
160 --bg-color: props.get(vars.$transparent-colors, $theme, --200), 162 --bg-color: props.get(core.$transparent-colors, $theme, --200),
161 --label-color: props.get(vars.$transparent-colors, $theme, --500), 163 --label-color: props.get(core.$transparent-colors, $theme, --500),
162 --border-color: props.get(vars.$transparent-colors, $theme, --100), 164 --border-color: props.get(core.$transparent-colors, $theme, --100),
163 ), 165 ),
164 ), 166 ),
165 167
166 --quiet: ( 168 --quiet: (
167 --label-color: props.get(vars.$transparent-colors, $theme, --900), 169 --label-color: props.get(core.$transparent-colors, $theme, --900),
168 170
169 --hover: ( 171 --hover: (
170 --bg-color: props.get(vars.$transparent-colors, $theme, --300), 172 --bg-color: props.get(core.$transparent-colors, $theme, --300),
171 --label-color: props.get(vars.$transparent-colors, $theme, --900), 173 --label-color: props.get(core.$transparent-colors, $theme, --900),
172 ), 174 ),
173 175
174 --active: ( 176 --active: (
175 --bg-color: props.get(vars.$transparent-colors, $theme, --400), 177 --bg-color: props.get(core.$transparent-colors, $theme, --400),
176 --label-color: props.get(vars.$transparent-colors, $theme, --900), 178 --label-color: props.get(core.$transparent-colors, $theme, --900),
177 ), 179 ),
178 180
179 --disabled: ( 181 --disabled: (
180 --label-color: props.get(vars.$transparent-colors, $theme, --500), 182 --label-color: props.get(core.$transparent-colors, $theme, --500),
181 ), 183 ),
182 ), 184 ),
183 ) 185 )
diff --git a/src/objects/_alert.scss b/src/objects/_alert.scss
index 774b443..651ad23 100644
--- a/src/objects/_alert.scss
+++ b/src/objects/_alert.scss
@@ -1,42 +1,24 @@
1@use 'sass:map';
2@use 'sass:meta';
1@use 'iro-sass/src/iro-sass' as iro; 3@use 'iro-sass/src/iro-sass' as iro;
2@use '../functions' as fn; 4@use '../props';
3 5
4$themes: 'accent' 'positive' 'negative' 'warning' !default; 6@forward 'alert.vars';
7@use 'alert.vars' as vars;
5 8
6@include iro.props-namespace('alert') { 9@mixin styles {
7 @include iro.props-store(( 10 @include props.materialize(meta.module-variables('vars'));
8 --dims: (
9 --border: fn.global-dim(--border --medium),
10 --pad-i: fn.global-dim(--size --250),
11 --pad-b: fn.global-dim(--size --200),
12 --rounding: fn.global-dim(--rounding),
13 ),
14 --colors: (
15 --bg: fn.global-color(--bg-l2),
16 --border: fn.global-color(--text-mute-more),
17 ),
18 ));
19 11
20 @each $theme in $themes { 12 @include iro.bem-object('alert') {
21 @include iro.props-store(( 13 padding-block: props.get(vars.$pad-b);
22 --colors: ( 14 padding-inline: props.get(vars.$pad-i);
23 --#{$theme}: ( 15 background-color: props.get(vars.$bg-color);
24 --border: fn.global-color(--#{$theme} --700), 16 border: props.get(vars.$border-width) solid props.get(vars.$border-color);
25 ), 17 border-radius: props.get(vars.$rounding);
26 ),
27 ));
28 }
29
30 @include iro.bem-object(iro.props-namespace()) {
31 padding-block: fn.dim(--pad-b);
32 padding-inline: fn.dim(--pad-i);
33 background-color: fn.color(--bg);
34 border: fn.dim(--border) solid fn.color(--border);
35 border-radius: fn.dim(--rounding);
36 18
37 @each $theme in $themes { 19 @each $mod, $theme in vars.$themes {
38 @include iro.bem-modifier($theme) { 20 @include iro.bem-modifier($mod) {
39 border-color: fn.color(--#{$theme} --border); 21 border-color: props.get(vars.$populated-themes, $theme, --border-color);
40 } 22 }
41 } 23 }
42 } 24 }
diff --git a/src/objects/_alert.vars.scss b/src/objects/_alert.vars.scss
index e69de29..64d8f1f 100644
--- a/src/objects/_alert.vars.scss
+++ b/src/objects/_alert.vars.scss
@@ -0,0 +1,26 @@
1@use '../props';
2@use '../core';
3
4$border-width: props.def(--o-alert--border-width, props.get(core.$border-width--medium)) !default;
5$pad-i: props.def(--o-alert--pad-i, props.get(core.$size--250)) !default;
6$pad-b: props.def(--o-alert--pad-b, props.get(core.$size--200)) !default;
7$rounding: props.def(--o-alert--rounding, props.get(core.$rounding)) !default;
8
9$bg-color: props.def(--o-alert--bg-color, props.get(core.$theme, --bg-l2)) !default;
10$border-color: props.def(--o-alert--bg-color, props.get(core.$theme, --text-mute-more)) !default;
11
12$themes: (
13 accent: --accent,
14 positive: --positive,
15 negative: --negative,
16 warning: --warning,
17) !default;
18
19$populated-themes: props.def(--o-alert);
20@each $theme, $key in $themes {
21 $populated-themes: props.merge($populated-themes, (
22 $key: (
23 --border-color: props.get(core.$theme, $key, --700),
24 )
25 ));
26}
diff --git a/src/objects/_avatar.scss b/src/objects/_avatar.scss
index d9c1105..45567b9 100644
--- a/src/objects/_avatar.scss
+++ b/src/objects/_avatar.scss
@@ -1,101 +1,52 @@
1@use 'sass:list'; 1@use 'sass:meta';
2@use 'iro-sass/src/iro-sass' as iro; 2@use 'iro-sass/src/iro-sass' as iro;
3@use '../functions' as fn; 3@use '../props';
4 4
5$sizes: 'xs' 'sm' 'lg' 'xl' 'xxl' 'xxxl'; 5@forward 'avatar.vars';
6@use 'avatar.vars' as vars;
6 7
7@mixin status($size: ()) { 8@mixin status($indicator-size) {
8 @include iro.bem-elem('status') { 9 @include iro.bem-elem('status') {
9 inline-size: fn.dim(list.join($size, --indicator-size)); 10 inline-size: props.get($indicator-size);
10 block-size: fn.dim(list.join($size, --indicator-size)); 11 block-size: props.get($indicator-size);
11 12
12 @include iro.bem-next-elem('content') { 13 @include iro.bem-next-elem('content') {
13 mask-image: radial-gradient(circle calc(.5 * fn.dim(list.join($size, --indicator-size)) + fn.dim(--indicator-spacing)) at 14 mask-image: radial-gradient(circle calc(.5 * props.get($indicator-size) + props.get(vars.$indicator-spacing)) at
14 calc(100% - .5 * fn.dim(list.join($size, --indicator-size))) 15 calc(100% - .5 * props.get($indicator-size))
15 calc(100% - .5 * fn.dim(list.join($size, --indicator-size))), 16 calc(100% - .5 * props.get($indicator-size)),
16 transparent 95%, 17 transparent 95%,
17 #fff); 18 #fff);
18 } 19 }
19 } 20 }
20} 21}
21 22
22@include iro.props-namespace('avatar') { 23@mixin styles {
23 @include iro.props-store(( 24 @include props.materialize(meta.module-variables('vars'));
24 --dims: (
25 --size: fn.global-dim(--size --500),
26 --font-size: fn.global-dim(--font-size --100),
27 --indicator-size: fn.global-dim(--size --150),
28 --indicator-spacing: fn.global-dim(--size --40),
29 --rounding: 25%,
30 25
31 --xxxl: ( 26 @include iro.bem-object('avatar') {
32 --size: fn.global-dim(--size --1600),
33 --font-size: fn.global-dim(--font-size --800),
34 --indicator-size: fn.global-dim(--size --400),
35 ),
36 --xxl: (
37 --size: fn.global-dim(--size --1200),
38 --font-size: fn.global-dim(--font-size --600),
39 --indicator-size: fn.global-dim(--size --300),
40 ),
41 --xl: (
42 --size: fn.global-dim(--size --800),
43 --font-size: fn.global-dim(--font-size --300),
44 --indicator-size: fn.global-dim(--size --225),
45 ),
46 --lg: (
47 --size: fn.global-dim(--size --650),
48 --font-size: fn.global-dim(--font-size --200),
49 --indicator-size: fn.global-dim(--size --175),
50 ),
51 --sm: (
52 --size: fn.global-dim(--size --375),
53 --font-size: fn.global-dim(--font-size --75),
54 --indicator-size: fn.global-dim(--size --125),
55 ),
56 --xs: (
57 --size: fn.global-dim(--size --250),
58 --font-size: fn.global-dim(--font-size --50),
59 --indicator-size: fn.global-dim(--size --100),
60 ),
61
62 --key-focus: (
63 --border: fn.global-dim(--key-focus --border),
64 --border-offset: fn.global-dim(--key-focus --border-offset),
65 --outline: fn.global-dim(--key-focus --outline),
66 ),
67 ),
68 --colors: (
69 --h: 354,
70 --s: 44%,
71 --l: 45%,
72
73 --key-focus: (
74 --border: fn.global-color(--focus --border),
75 --outline: fn.global-color(--focus --outline),
76 ),
77 ),
78 ));
79
80 @include iro.bem-object(iro.props-namespace()) {
81 position: relative; 27 position: relative;
82 display: inline-block; 28 display: inline-block;
83 font-size: fn.dim(--font-size); 29 font-size: props.get(vars.$font-size);
84 font-style: normal; 30 font-style: normal;
85 vertical-align: .05em; 31 vertical-align: .05em;
86 border-radius: fn.dim(--rounding); 32 border-radius: props.get(vars.$rounding);
87 33
88 &::after { 34 &::after {
89 position: absolute; 35 position: absolute;
90 inset: calc(-1 * fn.dim(--key-focus --border-offset)); 36 inset: calc(-1 * props.get(vars.$key-focus--border-offset));
91 z-index: 1; 37 z-index: 1;
92 display: none; 38 display: none;
93 pointer-events: none; 39 pointer-events: none;
94 content: ''; 40 content: '';
95 border: fn.dim(--key-focus --border-offset) solid transparent; 41 border: props.get(vars.$key-focus--border-offset) solid transparent;
96 border-radius: fn.dim(--rounding); 42 border-radius: props.get(vars.$rounding);
97 outline: fn.color(--key-focus --border) solid fn.dim(--key-focus --border); 43 outline: props.get(vars.$key-focus--border-color) solid props.get(vars.$key-focus--border-width);
98 box-shadow: 0 0 0 calc(fn.dim(--key-focus --border) + fn.dim(--key-focus --outline)) fn.color(--key-focus --outline); 44 box-shadow:
45 0
46 0
47 0
48 calc(props.get(vars.$key-focus--border-width) + props.get(vars.$key-focus--outline-width))
49 props.get(vars.$key-focus--outline-color);
99 } 50 }
100 51
101 @include iro.bem-elem('status') { 52 @include iro.bem-elem('status') {
@@ -104,17 +55,17 @@ $sizes: 'xs' 'sm' 'lg' 'xl' 'xxl' 'xxxl';
104 inset-inline-end: 0; 55 inset-inline-end: 0;
105 } 56 }
106 57
107 @include status; 58 @include status(vars.$indicator-size);
108 59
109 @include iro.bem-elem('content') { 60 @include iro.bem-elem('content') {
110 display: block; 61 display: block;
111 inline-size: fn.dim(--size); 62 inline-size: props.get(vars.$size);
112 block-size: fn.dim(--size); 63 block-size: props.get(vars.$size);
113 line-height: fn.dim(--size); 64 line-height: props.get(vars.$size);
114 text-align: center; 65 text-align: center;
115 object-fit: cover; 66 object-fit: cover;
116 object-position: center center; 67 object-position: center center;
117 border-radius: fn.dim(--rounding); 68 border-radius: props.get(vars.$rounding);
118 } 69 }
119 70
120 @include iro.bem-modifier('circle') { 71 @include iro.bem-modifier('circle') {
@@ -131,27 +82,27 @@ $sizes: 'xs' 'sm' 'lg' 'xl' 'xxl' 'xxxl';
131 82
132 @include iro.bem-modifier('placeholder') { 83 @include iro.bem-modifier('placeholder') {
133 @include iro.bem-elem('content') { 84 @include iro.bem-elem('content') {
134 background-color: hsl(0, 0%, fn.color(--l)); 85 background-color: hsl(0, 0%, props.get(vars.$bg-color--l));
135 } 86 }
136 } 87 }
137 88
138 @include iro.bem-modifier('colored') { 89 @include iro.bem-modifier('colored') {
139 @include iro.bem-elem('content') { 90 @include iro.bem-elem('content') {
140 color: #fff; 91 color: #fff;
141 background-color: hsl(fn.color(--h), fn.color(--s), fn.color(--l)); 92 background-color: hsl(props.get(vars.$bg-color--h), props.get(vars.$bg-color--s), props.get(vars.$bg-color--l));
142 } 93 }
143 } 94 }
144 95
145 @each $size in $sizes { 96 @each $mod, $size, $font-size, $indicator-size in vars.$sizes {
146 @include iro.bem-modifier($size) { 97 @include iro.bem-modifier($mod) {
147 font-size: fn.dim(--#{$size} --font-size); 98 font-size: props.get($font-size);
148 99
149 @include status(--#{$size}); 100 @include status($indicator-size);
150 101
151 @include iro.bem-elem('content') { 102 @include iro.bem-elem('content') {
152 inline-size: fn.dim(--#{$size} --size); 103 inline-size: props.get($size);
153 block-size: fn.dim(--#{$size} --size); 104 block-size: props.get($size);
154 line-height: fn.dim(--#{$size} --size); 105 line-height: props.get($size);
155 } 106 }
156 } 107 }
157 } 108 }
diff --git a/src/objects/_avatar.vars.scss b/src/objects/_avatar.vars.scss
new file mode 100644
index 0000000..5b97ec8
--- /dev/null
+++ b/src/objects/_avatar.vars.scss
@@ -0,0 +1,52 @@
1@use '../props';
2@use '../core';
3
4$size: props.def(--o-avatar--size, props.get(core.$size--500)) !default;
5$font-size: props.def(--o-avatar--font-size, props.get(core.$font-size--100)) !default;
6$indicator-size: props.def(--o-avatar--indicator-size, props.get(core.$size--150)) !default;
7$indicator-spacing: props.def(--o-avatar--indicator-spacing, props.get(core.$size--40)) !default;
8$rounding: props.def(--o-avatar--rounding, 25%) !default;
9
10$size--xxxl: props.def(--o-avatar--xxxl--size, props.get(core.$size--1600)) !default;
11$font-size--xxxl: props.def(--o-avatar--xxxl--font-size, props.get(core.$font-size--800)) !default;
12$indicator-size--xxxl: props.def(--o-avatar--xxxl--indicator-size, props.get(core.$size--400)) !default;
13
14$size--xxl: props.def(--o-avatar--xxl--size, props.get(core.$size--1200)) !default;
15$font-size--xxl: props.def(--o-avatar--xxl--font-size, props.get(core.$font-size--600)) !default;
16$indicator-size--xxl: props.def(--o-avatar--xxl--indicator-size, props.get(core.$size--300)) !default;
17
18$size--xl: props.def(--o-avatar--xl--size, props.get(core.$size--800)) !default;
19$font-size--xl: props.def(--o-avatar--xl--font-size, props.get(core.$font-size--300)) !default;
20$indicator-size--xl: props.def(--o-avatar--xl--indicator-size, props.get(core.$size--225)) !default;
21
22$size--lg: props.def(--o-avatar--lg--size, props.get(core.$size--650)) !default;
23$font-size--lg: props.def(--o-avatar--lg--font-size, props.get(core.$font-size--200)) !default;
24$indicator-size--lg: props.def(--o-avatar--lg--indicator-size, props.get(core.$size--175)) !default;
25
26$size--sm: props.def(--o-avatar--sm--size, props.get(core.$size--375)) !default;
27$font-size--sm: props.def(--o-avatar--sm--font-size, props.get(core.$font-size--75)) !default;
28$indicator-size--sm: props.def(--o-avatar--sm--indicator-size, props.get(core.$size--125)) !default;
29
30$size--xs: props.def(--o-avatar--xs--size, props.get(core.$size--250)) !default;
31$font-size--xs: props.def(--o-avatar--xs--font-size, props.get(core.$font-size--50)) !default;
32$indicator-size--xs: props.def(--o-avatar--xs--indicator-size, props.get(core.$size--100)) !default;
33
34$key-focus--border-width: props.def(--o-avatar--key-focus--border-width, props.get(core.$key-focus--border-width)) !default;
35$key-focus--border-offset: props.def(--o-avatar--key-focus--border-offset, props.get(core.$key-focus--border-offset)) !default;
36$key-focus--outline-width: props.def(--o-avatar--key-focus--outline-width, props.get(core.$key-focus--outline-width)) !default;
37
38$bg-color--h: props.def(--o-avatar--bg-color--h, 354) !default;
39$bg-color--s: props.def(--o-avatar--bg-color--s, 44%) !default;
40$bg-color--l: props.def(--o-avatar--bg-color--l, 45%) !default;
41
42$key-focus--border-color: props.def(--o-avatar--key-focus--border-color, props.get(core.$theme, --focus, --border)) !default;
43$key-focus--outline-color: props.def(--o-avatar--key-focus--outline-color, props.get(core.$theme, --focus, --outline)) !default;
44
45$sizes: (
46 'xs' $size--xs $font-size--xs $indicator-size--xs,
47 'sm' $size--sm $font-size--sm $indicator-size--sm,
48 'lg' $size--lg $font-size--lg $indicator-size--lg,
49 'xl' $size--xl $font-size--xl $indicator-size--xl,
50 'xxl' $size--xxl $font-size--xxl $indicator-size--xxl,
51 'xxxl' $size--xxxl $font-size--xxxl $indicator-size--xxxl,
52) !default;
diff --git a/src/objects/_heading.scss b/src/objects/_heading.scss
index 7fbafea..8ed3b17 100644
--- a/src/objects/_heading.scss
+++ b/src/objects/_heading.scss
@@ -31,10 +31,10 @@ $sizes: 'xxl' 'xl' 'lg' 'md' 'sm' 'xs';
31 31
32 @include iro.bem-elem('highlight') { 32 @include iro.bem-elem('highlight') {
33 background-image: linear-gradient(to top, 33 background-image: linear-gradient(to top,
34 transparent .05em, 34 transparent .05em,
35 fn.color(--bg) .05em, 35 fn.color(--bg) .05em,
36 fn.color(--bg) .5em, 36 fn.color(--bg) .5em,
37 transparent .5em); 37 transparent .5em);
38 } 38 }
39 39
40 @include iro.bem-modifier('xxl') { 40 @include iro.bem-modifier('xxl') {