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

Make sure Link is underlined when inline={true} #4531

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dipree
Copy link
Contributor

@dipree dipree commented Apr 23, 2024

Related to https://github.com/github/primer/issues/2099

Currently, the inline property only works in combination with the data-a11y-link-underlines attribute. However, the link should always be underlined if inline is set to true and no attribute is provided.

Changelog

Changed

If inline is set to true, the Link will be underlined even if not using the data-a11y-link-underlines attribute.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Apr 23, 2024

🦋 Changeset detected

Latest commit: 7088054

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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

@dipree dipree changed the title Make sure Link is underlined when inline set to true Make sure Link is underlined when inline={true} Apr 23, 2024
Copy link
Contributor

github-actions bot commented Apr 23, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 88.03 KB (-0.01% 🔽)
packages/react/dist/browser.umd.js 88.25 KB (-0.13% 🔽)

Comment on lines 34 to +35
text-decoration: ${props => (props.underline ? 'underline' : undefined)};
text-decoration: ${props => (props.inline ? 'underline' : undefined)};
Copy link
Member

Choose a reason for hiding this comment

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

I think we'll need one line otherwise the inline value will always override, maybe something like:

Suggested change
text-decoration: ${props => (props.underline ? 'underline' : undefined)};
text-decoration: ${props => (props.inline ? 'underline' : undefined)};
text-decoration: ${props => (props.underline || props.inline ? 'underline' : undefined)};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, it's not a problem but definitely better style. Remaining problem is the data attribute if set to false affecting the underline: true. We might want to deprecate underline first 🤔

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.

None yet

2 participants