diff options
author | Volpeon <git@volpeon.ink> | 2024-10-19 08:51:30 +0200 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2024-10-19 08:51:30 +0200 |
commit | 6448b40f6224b271acb6010cac0672dec4755341 (patch) | |
tree | e0f103be526e9d19b244b1ab2d9ff95d99a1419e /src/objects/_emoji.scss | |
parent | Update (diff) | |
download | iro-design-6448b40f6224b271acb6010cac0672dec4755341.tar.gz iro-design-6448b40f6224b271acb6010cac0672dec4755341.tar.bz2 iro-design-6448b40f6224b271acb6010cac0672dec4755341.zip |
Update
Diffstat (limited to 'src/objects/_emoji.scss')
-rw-r--r-- | src/objects/_emoji.scss | 72 |
1 files changed, 24 insertions, 48 deletions
diff --git a/src/objects/_emoji.scss b/src/objects/_emoji.scss index 41c614c..7747bbf 100644 --- a/src/objects/_emoji.scss +++ b/src/objects/_emoji.scss | |||
@@ -1,72 +1,48 @@ | |||
1 | @use 'sass:meta'; | ||
1 | @use 'iro-sass/src/iro-sass' as iro; | 2 | @use 'iro-sass/src/iro-sass' as iro; |
2 | @use '../functions' as fn; | 3 | @use '../props'; |
3 | @use 'sass:math'; | 4 | @use 'icon.vars' as icon; |
4 | 5 | ||
5 | @use 'icon'; | 6 | @forward 'emoji.vars'; |
7 | @use 'emoji.vars' as vars; | ||
6 | 8 | ||
7 | @include iro.props-namespace('emoji') { | 9 | @mixin styles { |
8 | @include iro.props-store(( | 10 | @include props.materialize(meta.module-variables('vars')); |
9 | --dims: ( | ||
10 | --size: calc(1 / 14 * 18em), | ||
11 | --pad: .3em, | ||
12 | --rounding: fn.global-dim(--rounding), | ||
13 | --zoom: 3, | ||
14 | --valign: -.25em, | ||
15 | 11 | ||
16 | --125: ( | 12 | @include iro.bem-object('emoji') { |
17 | --size: calc(1 / 14 * 23em), | ||
18 | --valign: -.45em, | ||
19 | ), | ||
20 | |||
21 | --150: ( | ||
22 | --size: calc(1 / 14 * 28em), | ||
23 | --valign: -.65em, | ||
24 | ), | ||
25 | |||
26 | --200: ( | ||
27 | --size: calc(1 / 14 * 38em), | ||
28 | --valign: -1em, | ||
29 | ) | ||
30 | ), | ||
31 | --colors: ( | ||
32 | --bg: fn.global-color(--border-mute), | ||
33 | ) | ||
34 | )); | ||
35 | |||
36 | @include iro.bem-object(iro.props-namespace()) { | ||
37 | position: relative; | 13 | position: relative; |
38 | display: inline-block; | 14 | display: inline-block; |
39 | inline-size: calc(fn.dim(--size)); | 15 | inline-size: calc(props.get(vars.$size)); |
40 | block-size: calc(fn.dim(--size)); | 16 | block-size: calc(props.get(vars.$size)); |
41 | padding: calc(fn.dim(--pad)); | 17 | padding: calc(props.get(vars.$pad)); |
42 | margin: calc(-1 * fn.dim(--pad)); | 18 | margin: calc(-1 * props.get(vars.$pad)); |
43 | vertical-align: fn.dim(--valign); | 19 | vertical-align: props.get(vars.$valign); |
44 | object-fit: contain; | 20 | object-fit: contain; |
45 | 21 | ||
46 | @include iro.bem-modifier('icon') { | 22 | @include iro.bem-modifier('icon') { |
47 | margin: calc(-1 * fn.dim(--pad) - .5 * (fn.dim(--size) - fn.foreign-dim(--icon, --size))); | 23 | margin: calc(-1 * props.get(vars.$pad) - .5 * (props.get(vars.$size) - props.get(icon.$size))); |
48 | vertical-align: fn.foreign-dim(--icon, --valign); | 24 | vertical-align: props.get(icon.$valign); |
49 | } | 25 | } |
50 | 26 | ||
51 | @each $size in '125' '150' '200' { | 27 | @each $mod, $size, $valign in vars.$sizes { |
52 | @include iro.bem-modifier($size) { | 28 | @include iro.bem-modifier($mod) { |
53 | inline-size: fn.dim(--#{$size} --size); | 29 | inline-size: props.get($size); |
54 | block-size: fn.dim(--#{$size} --size); | 30 | block-size: props.get($size); |
55 | vertical-align: fn.dim(--#{$size} --valign); | 31 | vertical-align: props.get($valign); |
56 | 32 | ||
57 | @include iro.bem-modifier('icon') { | 33 | @include iro.bem-modifier('icon') { |
58 | margin: calc(-1 * fn.dim(--pad) - .5 * (fn.dim(--#{$size} --size) - fn.foreign-dim(--icon, --size))); | 34 | margin: calc(-1 * props.get(vars.$pad) - .5 * (props.get($size) - props.get(icon.$size))); |
59 | } | 35 | } |
60 | } | 36 | } |
61 | } | 37 | } |
62 | 38 | ||
63 | @include iro.bem-modifier('zoomable') { | 39 | @include iro.bem-modifier('zoomable') { |
64 | border-radius: calc(fn.dim(--rounding) / fn.dim(--zoom)); | 40 | border-radius: calc(props.get(vars.$rounding) / props.get(vars.$zoom)); |
65 | transition: transform .2s ease, background-color .2s ease; | 41 | transition: transform .2s ease, background-color .2s ease; |
66 | 42 | ||
67 | &:hover { | 43 | &:hover { |
68 | background-color: fn.color(--bg); | 44 | background-color: props.get(vars.$bg-color); |
69 | transform: scale(fn.dim(--zoom)); | 45 | transform: scale(props.get(vars.$zoom)); |
70 | } | 46 | } |
71 | } | 47 | } |
72 | } | 48 | } |