-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
info_density: Calculate values for vertical alignment and apply to emoji. #30050
Conversation
Hello @zulip/server-emoji members, this pull request was labeled with the "area: emoji" label, so you may want to check it out! |
Test-deploying on chat.zulip.org. |
b76960b
to
5e3b904
Compare
Okay. I have updated this with an entirely different approach, as discussed on CZO--which discussion I'll be updating shortly with some of the things I've discovered here and want to share more widely. |
f932bbc
to
2df3380
Compare
Updating what's deployed on chat.zulip.org. |
2df3380
to
c8d6288
Compare
Updated to restore legacy oversize emoji. CZO discussion |
Merged, thanks @karlstolley! |
Owing to logic added in zulip#30050, which accounts for the legacy line- height value, toggling dense mode requires recalculating the typography vars--otherwise, a non-legacy line-height value will not be picked up until a refresh.
Owing to logic added in #30050, which accounts for the legacy line- height value, toggling dense mode requires recalculating the typography vars--otherwise, a non-legacy line-height value will not be picked up until a refresh.
This PR calculates values necessary to properly fit and vertically align inline-block elements within any given line height and font size combination. Those values are then applied as an example to inline emoji, though the techniques and values here are strong candidates to be extended to other blocks appearing within the message area (e.g., todo widget checkboxes,
<time>
elements).Additionally, previous fiddly
top
andmargin
values applied to emoji have been removed here, so that similarly fiddly adjustments are made unnecessary as users adjust information density values. A commit added on 11 June 2024 now also restores the oversize-emoji look that Zulip is known for, but critically without disturbing the surrounding lines of text (updated screenshots below).CZO discussion
To test this PR in dev, you'll see the default values just by running dev on this branch. The database-stored legacy font size and line-height equivalents can be made active by deselecting
Dense mode
under Settings > Preferences. To see the 16px/140% version, set those values in theMessage-area font size (px)
andMessage-area line height (%)
. Same with any other reasonable combination of font size and line-height you might be curious to examine.Screenshots and screen captures:
.more_dense_mode
)The screenshots here demonstrate that the oversize versions do not disturb the flow of text compared to their line-fitted counterparts.
The change at 16/140 is far less dramatic because the line-fitted size comes much closer to the oversize size.
Outdated screenshots
| Before | After (legacy font size/line height values) | | --- | --- | | ![legacy-emoji-before](https://github.com/zulip/zulip/assets/170719/6a35ad2a-ddf2-417e-b322-0dcc87e0814b) | ![legacy-emoji-after-calculated-offset](https://github.com/zulip/zulip/assets/170719/af241f8a-4d00-49bc-a9fa-0ac47ab531a5) |Showing shift-free text at 16px/140%
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: