info_density: Calculate values for vertical alignment and apply to emoji. #30050
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. The consequence of this is that emoji are now properly fitted to the line height, making them appear smaller than previously (though better in line with the size of surrounding text).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:
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: