summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/objects/_emoji.scss20
-rw-r--r--tpl/objects/emoji.pug9
-rw-r--r--tpl/views/emoji.pug10
3 files changed, 28 insertions, 11 deletions
diff --git a/src/objects/_emoji.scss b/src/objects/_emoji.scss
index 7d03b13..6ab71d7 100644
--- a/src/objects/_emoji.scss
+++ b/src/objects/_emoji.scss
@@ -22,13 +22,18 @@
22 ), 'colors'); 22 ), 'colors');
23 23
24 @include iro.bem-object(iro.props-namespace()) { 24 @include iro.bem-object(iro.props-namespace()) {
25 display: inline; 25 display: inline-flex;
26 width: 1em; 26 position: relative;
27 height: 1em; 27 align-items: center;
28 margin: calc(-.5 * fn.dim(--size)) calc(-1 * fn.dim(--pad)); 28 justify-content: center;
29 padding: fn.dim(--pad); 29 width: 1em;
30 font-size: fn.dim(--size); 30 height: 1em;
31 vertical-align: .15em; 31 margin: calc(-.5 * fn.dim(--size)) calc(-1 * fn.dim(--pad));
32 padding: fn.dim(--pad);
33 font-size: fn.dim(--size);
34 line-height: 1;
35 text-align: center;
36 vertical-align: middle;
32 37
33 @include iro.bem-modifier('125') { 38 @include iro.bem-modifier('125') {
34 margin-top: calc(-.5 * fn.dim(--125 --size)); 39 margin-top: calc(-.5 * fn.dim(--125 --size));
@@ -41,6 +46,7 @@
41 border-radius: calc(fn.dim(--rounding) / fn.dim(--zoom)); 46 border-radius: calc(fn.dim(--rounding) / fn.dim(--zoom));
42 47
43 &:hover { 48 &:hover {
49 z-index: 10;
44 transform: scale(fn.dim(--zoom)); 50 transform: scale(fn.dim(--zoom));
45 background-color: fn.color(--bg); 51 background-color: fn.color(--bg);
46 } 52 }
diff --git a/tpl/objects/emoji.pug b/tpl/objects/emoji.pug
index 3509112..af56c7a 100644
--- a/tpl/objects/emoji.pug
+++ b/tpl/objects/emoji.pug
@@ -11,6 +11,11 @@ mixin emoji(id)
11 classes['o-emoji--' + attributes.size] = true; 11 classes['o-emoji--' + attributes.size] = true;
12 } 12 }
13 13
14 src = id + '.png' 14 if (!attributes.unicode) {
15 src = id + '.png'
16 }
15 17
16 img(src=src, class=classes) 18 if !attributes.unicode
19 img(src=src, class=classes)
20 else
21 span(class=classes)= id
diff --git a/tpl/views/emoji.pug b/tpl/views/emoji.pug
index 8410794..2503e8d 100644
--- a/tpl/views/emoji.pug
+++ b/tpl/views/emoji.pug
@@ -4,17 +4,23 @@ mixin view-emoji
4 =loremIpsum 4 =loremIpsum
5 =' ' 5 =' '
6 +emoji('drgn') 6 +emoji('drgn')
7 +emoji('drgn') 7 =' '
8 +emoji('🐉️')(unicode=true)
8 =' ' 9 =' '
9 =loremIpsum 10 =loremIpsum
10 =' ' 11 =' '
11 +emoji('drgn')(zoomable=true) 12 +emoji('drgn')(zoomable=true)
12 =' ' 13 =' '
14 +emoji('🐉️')(zoomable=true unicode=true)
15 =' '
13 =loremIpsum 16 =loremIpsum
14 =' ' 17 =' '
15 +emoji('drgn')(size=125) 18 +emoji('drgn')(size=125)
16 +emoji('drgn')(size=125) 19 =' '
20 +emoji('🐉️')(unicode=true size=125)
17 =' ' 21 =' '
18 =loremIpsum 22 =loremIpsum
19 =' ' 23 =' '
20 +emoji('drgn')(zoomable=true size=125) 24 +emoji('drgn')(zoomable=true size=125)
25 =' '
26 +emoji('🐉️')(zoomable=true unicode=true size=125)