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

fix(TextLink): vertical alignment when used within flexbox container #2584

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

maxcheremisin
Copy link
Member

@maxcheremisin maxcheremisin commented Sep 28, 2023

Purpose of PR

Fix TextLink vertical alignment when used within flexbox container.

Problem

When used within a flexbox container TextLink stretches to full height. It used to have style="align-items: center" so when it's stretched it still would look aligned. But with recent changes in #2574 it was changed to style="align-items: baseline" to align it when used within inline text elements.

With this PR I'd like to return previous behaviour back (when TextLink is stretched to full height, and its elements are centrally aligned), but at the same time keep text and icon aligned to baseline when used within other text.

🚨 But to make it work I had to add an extra DOM element.

image
Bug screenshots

image

image

image

@changeset-bot
Copy link

changeset-bot bot commented Sep 28, 2023

🦋 Changeset detected

Latest commit: f48938d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@contentful/f36-text-link Patch
@contentful/f36-accordion Patch
@contentful/f36-asset Patch
@contentful/f36-autocomplete Patch
@contentful/f36-badge Patch
@contentful/f36-button Patch
@contentful/f36-card Patch
@contentful/f36-collapse Patch
@contentful/f36-copybutton Patch
@contentful/f36-core Patch
@contentful/f36-datetime Patch
@contentful/f36-datepicker Patch
@contentful/f36-drag-handle Patch
@contentful/f36-entity-list Patch
@contentful/f36-empty-state Patch
@contentful/f36-forms Patch
@contentful/f36-icon Patch
@contentful/f36-list Patch
@contentful/f36-menu Patch
@contentful/f36-modal Patch
@contentful/f36-note Patch
@contentful/f36-notification Patch
@contentful/f36-pagination Patch
@contentful/f36-pill Patch
@contentful/f36-popover Patch
@contentful/f36-skeleton Patch
@contentful/f36-spinner Patch
@contentful/f36-table Patch
@contentful/f36-tabs Patch
@contentful/f36-tooltip Patch
@contentful/f36-typography Patch
@contentful/f36-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
forma-36 ✅ Ready (Inspect) Visit Preview Sep 28, 2023 10:48am

@github-actions
Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
CommonJS 129.5 KB (+0.02% 🔺) 2.6 s (+0.02% 🔺) 106 ms (+73.25% 🔺) 2.7 s
Module 125.97 KB (+0.01% 🔺) 2.6 s (+0.01% 🔺) 67 ms (-7.57% 🔽) 2.6 s

@maxcheremisin
Copy link
Member Author

Worth mentioning that I had another idea to add style="align-self: center" to TextLink container, it would fix the central alignment, but it would make impossible to align the TextLink element to start or end.

Copy link
Contributor

@ghepting ghepting left a comment

Choose a reason for hiding this comment

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

lgtm! will hopefully avoid regressions in consumers, thanks for catching :)

@maxcheremisin maxcheremisin merged commit a331cc1 into main Sep 29, 2023
12 checks passed
@maxcheremisin maxcheremisin deleted the fix/text-link-vertical-alignment-in-flexbox branch September 29, 2023 13:18
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