Skip to content

Conversation

@indutny-signal
Copy link
Contributor

@indutny-signal indutny-signal commented Mar 1, 2023

Howdy!

I thought I upstream the patch that I ended up applying to my fork.

This commit adds --epr-sheet-x/y CSS variables to each non-native emoji. They can be used to turn emoji images into sprites through object-fit/object-position and calc. Example (with 2x scaling):

.EmojiPickerReact.epr-main  button.epr-emoji .epr-emoji-img {
   max-height: calc(2 * var(--epr-emoji-fullsize));
   max-width: calc(2 * var(--epr-emoji-fullsize));
   height: calc(2 * var(--epr-emoji-fullsize));
   width: calc(2 * var(--epr-emoji-fullsize));
   padding: calc(2* var(--epr-emoji-padding));
   object-fit: none;
   object-position: calc(-1 * var(--epr-sheet-x) * 66px) calc(-1 * var(--epr-sheet-y) * 66px);
   transform: scale(0.5);
 }

@ealush ealush force-pushed the master branch 2 times, most recently from 8673ce9 to d8ad1d4 Compare November 4, 2023 20:16
@ealush ealush force-pushed the master branch 8 times, most recently from e1e9bc5 to 76f2b14 Compare October 19, 2025 22:14
@ealush ealush force-pushed the master branch 5 times, most recently from 6f0292c to d2af775 Compare November 22, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant