Skip to content

Commit

Permalink
Use "transform: scale" to resize emoticons, and "zoom" when supported (
Browse files Browse the repository at this point in the history
  • Loading branch information
lorumic authored Dec 5, 2024
1 parent c67e508 commit b034092
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 11 deletions.
22 changes: 18 additions & 4 deletions webapp/channels/build/emoji/make_emojis.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,14 @@ const cssRules = `.emojisprite-preview {
background-repeat: no-repeat;
cursor: pointer;
-moz-transform: scale(0.5);
transform: scale(0.5);
transform-origin: 0 0;
// Using zoom for now as it results in less blurry emojis on Chrome - MM-34178
zoom: 0.5;
@supports (zoom: 0.5) {
-moz-transform: none;
transform: none;
zoom: 0.5;
}
}
.emojisprite {
Expand All @@ -453,7 +458,7 @@ const cssRules = `.emojisprite-preview {
border-radius: 18px;
cursor: pointer;
-moz-transform: scale(0.35);
zoom: 0.35;
transform: scale(0.35);
}
.emojisprite-loading {
Expand All @@ -465,7 +470,16 @@ const cssRules = `.emojisprite-preview {
border-radius: 18px;
cursor: pointer;
-moz-transform: scale(0.35);
zoom: 0.35;
transform: scale(0.35);
}
@supports (zoom: 0.35) {
.emojisprite,
.emojisprite-loading {
-moz-transform: none;
transform: none;
zoom: 0.35;
}
}
${cssCats.join('\n')}
Expand Down
22 changes: 18 additions & 4 deletions webapp/channels/src/sass/components/_emojisprite.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
background-repeat: no-repeat;
cursor: pointer;
-moz-transform: scale(0.5);
transform: scale(0.5);
transform-origin: 0 0;
// Using zoom for now as it results in less blurry emojis on Chrome - MM-34178
zoom: 0.5;

@supports (zoom: 0.5) {
-moz-transform: none;
transform: none;
zoom: 0.5;
}
}

.emojisprite {
Expand All @@ -18,7 +23,7 @@
background-repeat: no-repeat;
cursor: pointer;
-moz-transform: scale(0.35);
zoom: 0.35;
transform: scale(0.35);
}

.emojisprite-loading {
Expand All @@ -30,7 +35,16 @@
background-repeat: no-repeat;
cursor: pointer;
-moz-transform: scale(0.35);
zoom: 0.35;
transform: scale(0.35);
}

@supports (zoom: 0.35) {
.emojisprite,
.emojisprite-loading {
-moz-transform: none;
transform: none;
zoom: 0.35;
}
}

.emoji-category-recent { background-image: url('images/emoji-sheets/apple-sheet.png'); }
Expand Down
17 changes: 14 additions & 3 deletions webapp/channels/src/sass/components/_emoticons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -548,12 +548,23 @@ $emoji-footer-height: $emoji-footer-border-width + $emoji-half-height + $emoji-

img {
-moz-transform: scale(0.45);
zoom: 0.45;
transform: scale(0.45);

@supports (zoom: 0.45) {
-moz-transform: none;
transform: none;
zoom: 0.45;
}

&.emoji-category--custom {
-moz-transform: scale(1);
transform: scale(1.25);
zoom: 1;
transform: scale(1);

@supports (zoom: 1) {
-moz-transform: none;
transform: none;
zoom: 1;
}
}
}
}
Expand Down

0 comments on commit b034092

Please sign in to comment.