Skip to content

Link: Add inline prop to tag links inside a text block - #3946

Merged
siddharthkp merged 17 commits into
mainfrom
inline-link
Nov 20, 2023
Merged

Link: Add inline prop to tag links inside a text block#3946
siddharthkp merged 17 commits into
mainfrom
inline-link

Conversation

@siddharthkp

@siddharthkpsiddharthkp commented Nov 15, 2023

Copy link
Copy Markdown
Member

From A more readable GitHub,

Links embedded in text are most perceivable when they have distinct styling. Sufficient contrast with the surrounding text is good, but should not be used as the only method of visually distinguishing a link from other text content.

To remediate the problem we have implemented a new accessibility setting with two options: show or hide link underlines in text blocks. Those who need or prefer stylistic differentiation can now choose to enable them. The default is to underline links.

This PR implements the short term strategy from https://github.com/github/primer/discussions/2836#discussioncomment-7533878

Note: inline=true overrides underline=false and adds an underline

Story with all combinations: https://primer-091e4ade04-13348165.drafts.github.io/storybook/?path=/story/components-link-features--inline

@changeset-bot

changeset-botBot commented Nov 15, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8bb69b7

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

This PR includes changesets to release 1 package
NameType
@primer/reactPatch

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

@siddharthkpsiddharthkp added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 15, 2023
@github-actions

github-actionsBot commented Nov 15, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
dist/browser.esm.js104.3 KB (+0.05% 🔺)
dist/browser.umd.js104.84 KB (+0.05% 🔺)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-3946 November 15, 2023 16:36 Inactive
@siddharthkpsiddharthkp added update snapshots 🤖 Command that updates VRT snapshots on the pull request and removed update snapshots 🤖 Command that updates VRT snapshots on the pull request labels Nov 16, 2023

@joshblackjoshblack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great! Just had a comment for the story and also wanted to ask if this should be added to the Link.docs.json as well for the site?

</Link>
)

export const Inline = () => (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems like a good candidate for a dev story, similar to what we have for button (I think?). What would you think of having the example in the feature here be a link in a text block and this would be its own dev story?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good idea, done!

@github-actions
github-actionsBottemporarily deployed to storybook-preview-3946 November 20, 2023 19:12 Inactive
@siddharthkp
siddharthkp added this pull request to the merge queueNov 20, 2023
Merged via the queue into main with commit e08432dNov 20, 2023
@siddharthkp
siddharthkp deleted the inline-link branch November 20, 2023 19:26
@primerprimerBot mentioned this pull request Nov 20, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

update snapshots🤖 Command that updates VRT snapshots on the pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@siddharthkp@joshblack