Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set --epr-sheet-x/--epr-sheet-y CSS variables #323

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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);
 }

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.

None yet

1 participant