diff options
Diffstat (limited to 'src/_utils.scss')
-rw-r--r-- | src/_utils.scss | 67 |
1 files changed, 62 insertions, 5 deletions
diff --git a/src/_utils.scss b/src/_utils.scss index 598eae4..445e5c6 100644 --- a/src/_utils.scss +++ b/src/_utils.scss | |||
@@ -1,4 +1,5 @@ | |||
1 | @use 'sass:map'; | 1 | @use 'sass:map'; |
2 | @use 'sass:string'; | ||
2 | @use 'iro-sass/src/bem'; | 3 | @use 'iro-sass/src/bem'; |
3 | @use 'iro-sass/src/props'; | 4 | @use 'iro-sass/src/props'; |
4 | @use 'include-media/dist/include-media' as media; | 5 | @use 'include-media/dist/include-media' as media; |
@@ -9,12 +10,12 @@ | |||
9 | /* stylelint-disable-next-line scss/dollar-variable-pattern */ | 10 | /* stylelint-disable-next-line scss/dollar-variable-pattern */ |
10 | $-dirs: ( | 11 | $-dirs: ( |
11 | '': '', | 12 | '': '', |
13 | 'b': '-block', | ||
12 | 'bs': '-block-start', | 14 | 'bs': '-block-start', |
13 | 'be': '-block-end', | 15 | 'be': '-block-end', |
14 | 'b': '-block', | 16 | 'i': '-inline', |
15 | 'is': '-inline-start', | 17 | 'is': '-inline-start', |
16 | 'ie': '-inline-end', | 18 | 'ie': '-inline-end', |
17 | 'i': '-inline', | ||
18 | ) !default; | 19 | ) !default; |
19 | 20 | ||
20 | /* stylelint-disable-next-line scss/dollar-variable-pattern */ | 21 | /* stylelint-disable-next-line scss/dollar-variable-pattern */ |
@@ -96,8 +97,8 @@ $-sizes: ( | |||
96 | vertical-align: baseline; | 97 | vertical-align: baseline; |
97 | } | 98 | } |
98 | 99 | ||
99 | @include bem.utility('va-center') { | 100 | @include bem.utility('va-middle') { |
100 | vertical-align: center; | 101 | vertical-align: middle; |
101 | } | 102 | } |
102 | 103 | ||
103 | @include bem.utility('va-bottom') { | 104 | @include bem.utility('va-bottom') { |
@@ -132,6 +133,10 @@ $-sizes: ( | |||
132 | align-items: flex-end; | 133 | align-items: flex-end; |
133 | } | 134 | } |
134 | 135 | ||
136 | @include bem.utility('ac-center') { | ||
137 | align-content: center; | ||
138 | } | ||
139 | |||
135 | @include bem.utility('jc-center') { | 140 | @include bem.utility('jc-center') { |
136 | justify-content: center; | 141 | justify-content: center; |
137 | } | 142 | } |
@@ -154,18 +159,50 @@ $-sizes: ( | |||
154 | 159 | ||
155 | @include bem.utility('c-heading') { | 160 | @include bem.utility('c-heading') { |
156 | color: props.get(vars.$theme, --heading); | 161 | color: props.get(vars.$theme, --heading); |
162 | |||
163 | @each $theme in map.keys(props.get(vars.$transparent-colors)) { | ||
164 | $theme-name: static-#{string.slice($theme, 3)}; | ||
165 | |||
166 | @include bem.at-theme($theme-name) { | ||
167 | color: props.get(vars.$transparent-colors, $theme, --900); | ||
168 | } | ||
169 | } | ||
157 | } | 170 | } |
158 | 171 | ||
159 | @include bem.utility('c-text') { | 172 | @include bem.utility('c-text') { |
160 | color: props.get(vars.$theme, --text); | 173 | color: props.get(vars.$theme, --text); |
174 | |||
175 | @each $theme in map.keys(props.get(vars.$transparent-colors)) { | ||
176 | $theme-name: static-#{string.slice($theme, 3)}; | ||
177 | |||
178 | @include bem.at-theme($theme-name) { | ||
179 | color: props.get(vars.$transparent-colors, $theme, --800); | ||
180 | } | ||
181 | } | ||
161 | } | 182 | } |
162 | 183 | ||
163 | @include bem.utility('c-mute') { | 184 | @include bem.utility('c-mute') { |
164 | color: props.get(vars.$theme, --text-mute); | 185 | color: props.get(vars.$theme, --text-mute); |
186 | |||
187 | @each $theme in map.keys(props.get(vars.$transparent-colors)) { | ||
188 | $theme-name: static-#{string.slice($theme, 3)}; | ||
189 | |||
190 | @include bem.at-theme($theme-name) { | ||
191 | color: props.get(vars.$transparent-colors, $theme, --700); | ||
192 | } | ||
193 | } | ||
165 | } | 194 | } |
166 | 195 | ||
167 | @include bem.utility('c-mute-more') { | 196 | @include bem.utility('c-mute-more') { |
168 | color: props.get(vars.$theme, --text-mute-more); | 197 | color: props.get(vars.$theme, --text-mute-more); |
198 | |||
199 | @each $theme in map.keys(props.get(vars.$transparent-colors)) { | ||
200 | $theme-name: static-#{string.slice($theme, 3)}; | ||
201 | |||
202 | @include bem.at-theme($theme-name) { | ||
203 | color: props.get(vars.$transparent-colors, $theme, --600); | ||
204 | } | ||
205 | } | ||
169 | } | 206 | } |
170 | 207 | ||
171 | @each $dir, $prop in (is: inline-size, bs: block-size) { | 208 | @each $dir, $prop in (is: inline-size, bs: block-size) { |
@@ -200,6 +237,14 @@ $-sizes: ( | |||
200 | white-space: nowrap; | 237 | white-space: nowrap; |
201 | } | 238 | } |
202 | 239 | ||
240 | @include bem.utility('o-auto') { | ||
241 | overflow: auto; | ||
242 | } | ||
243 | |||
244 | @include bem.utility('o-hidden') { | ||
245 | overflow: hidden; | ||
246 | } | ||
247 | |||
203 | @include bem.utility('p-static') { | 248 | @include bem.utility('p-static') { |
204 | position: static; | 249 | position: static; |
205 | } | 250 | } |
@@ -214,7 +259,7 @@ $-sizes: ( | |||
214 | 259 | ||
215 | @include bem.utility('p-sticky-bs') { | 260 | @include bem.utility('p-sticky-bs') { |
216 | position: sticky; | 261 | position: sticky; |
217 | inset-block-start: 0; | 262 | inset-block-start: props.get(vars.$sticky-top-offset); |
218 | } | 263 | } |
219 | 264 | ||
220 | @include bem.utility('p-sticky-be') { | 265 | @include bem.utility('p-sticky-be') { |
@@ -301,4 +346,16 @@ $-sizes: ( | |||
301 | content: ''; | 346 | content: ''; |
302 | } | 347 | } |
303 | } | 348 | } |
349 | |||
350 | @include bem.utility('sr-only') { | ||
351 | position: absolute; | ||
352 | width: 1px; | ||
353 | height: 1px; | ||
354 | padding: 0; | ||
355 | margin: -1px; | ||
356 | overflow: hidden; | ||
357 | clip-path: inset(50%); | ||
358 | white-space: nowrap; | ||
359 | border: 0; | ||
360 | } | ||
304 | } | 361 | } |