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

Support custom font size for Emoji Preview text #739

Merged

Conversation

cmunozgar
Copy link
Contributor

@cmunozgar cmunozgar commented Nov 21, 2022

Set a custom font size for the Emoji Preview placeholder text. By default, 21px.

CleanShot 2022-11-21 at 08 33 30@2x

Copy link

@guldenmw guldenmw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @cmunozgar 🙂

I left a couple of comments that I think would make this more clear.

packages/emoji-mart/src/components/Picker/Picker.tsx Outdated Show resolved Hide resolved
packages/emoji-mart/src/components/Picker/PickerProps.ts Outdated Show resolved Hide resolved
@cmunozgar
Copy link
Contributor Author

Hey @cmunozgar 🙂

I left a couple of comments that I think would make this more clear.

Thanks for the suggestions @guldenmw

@cmunozgar cmunozgar requested a review from guldenmw November 23, 2022 10:36
@EtienneLem
Copy link
Member

Thanks for the PR. I feel like it would make more sense as a CSS variable, so that it can be configured via CSS (i.e. https://missiveapp.com/open/emoji-mart/example-custom-styles.html).

Eventually, we will add CSS Shadow Parts (see example https://css-tricks.com/styling-in-the-shadow-dom-with-css-shadow-parts) so that every part is easier to customize.

@cmunozgar
Copy link
Contributor Author

Thanks for the PR. I feel like it would make more sense as a CSS variable, so that it can be configured via CSS (i.e. https://missiveapp.com/open/emoji-mart/example-custom-styles.html).

Eventually, we will add CSS Shadow Parts (see example https://css-tricks.com/styling-in-the-shadow-dom-with-css-shadow-parts) so that every part is easier to customize.

Thank you, @EtienneLem, for your response!

I have simplified the PR to use the CSS variable instead, following the same naming convention.

Let me know if this one makes more sense.

@EtienneLem
Copy link
Member

Thank you @cmunozgar. I have updated it a bit:

  • The em-* variables are meant to be internal; I added a few ones that will be more friendly to use.
  • I added variables to control the font-size of the preview when hovering as well

It will be configurable like this:

em-emoji-picker {
  --preview-placeholder-size: 14px;
}

@EtienneLem EtienneLem merged commit eb6941e into missive:main Jan 12, 2023
@cmunozgar cmunozgar deleted the add-emoji-preview-font-size-customization branch January 12, 2023 21:47
@cmunozgar
Copy link
Contributor Author

Thank you @EtienneLem!

@@ -46,6 +46,10 @@

--sidebar-width: 16px;

--preview-placeholder-size: 21px;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I realize here @EtienneLem is that we should probably use an internal variable name and check if a global variable is present or if the value should default to 21px. Otherwise, there's no way to customize the size.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've created this small PR to address the override of the CSS variable: #779

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be working in v5.5.1

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.

3 participants