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

Seemingly unnecessary image styling in custom emojis inside picker #720

Closed
jrnxf opened this issue Nov 3, 2022 · 2 comments · Fixed by #721
Closed

Seemingly unnecessary image styling in custom emojis inside picker #720

jrnxf opened this issue Nov 3, 2022 · 2 comments · Fixed by #721

Comments

@jrnxf
Copy link
Contributor

jrnxf commented Nov 3, 2022

Due to the rigid styling decisions made inside the Emoji.tsx file here, custom emojis render with position: relative and top: '.1em', making them not render in line with native emojis.

<span class="emoji-mart-emoji" data-emoji-set={props.set}>
  {imageSrc ? (
    <img
      style={{
        height: props.size || '1em',
        width: 'auto',
        display: 'inline-block',
        position: 'relative',
        top: '.1em',
      }}
      alt={emojiSkin.native || emojiSkin.shortcodes}
      src={imageSrc}
    />
  ) ...

Here's some sample output:

image

Given the css styling happens in the shadow-root, I'm unable to change the styling here, otherwise I happily would. I don't see a good reason to have these styles forced upon the end user, and am not sure if there's a reason they are there in the first place. Am I okay to submit a PR to remove them? At the very least could we add a custom styles prop to be passed in that sets the styles here?

@EtienneLem
Copy link
Member

I will admit that I don’t 100% recall why that is 🤔. Definitely sounds like we should remove; all in for a PR! 👍🏼

@jrnxf
Copy link
Contributor Author

jrnxf commented Nov 6, 2022

Sounds great @EtienneLem. I'm out right now but will open a PR tonight!

A friend of mine pointed out that the styling may have been done this way to make the custom emoji section render similar to the others, but I haven't double-checked that yet. Even if this is the case I can fix that bug without subjecting the user to the conflicting styles above. 🍻

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 a pull request may close this issue.

2 participants