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

Update Link inline prop description and deprecate underline #4135

Merged
merged 7 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nice-seals-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Deprecate the `underline` property of the Link component in favor of the new `inline` property to better handle link visibility and accessibility when adjacent to text.
9 changes: 5 additions & 4 deletions src/Link/Link.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,26 @@
"name": "muted",
"type": "boolean",
"defaultValue": "false",
"description": "Uses a less prominent shade for Link color, and the default link shade on hover"
"description": "Uses a less prominent shade for Link color, and the default link shade on hover."
},
{
"name": "inline",
"type": "boolean",
"defaultValue": "false",
"description": "Tag link inside a text block"
"description": "Set to true for links adjacent to text, underlining them for clear visibility and improved accessibility."
},
{
"name": "underline",
"type": "boolean",
"defaultValue": "false",
"description": "Adds underline to the Link"
"description": "Use `inline` instead.",
"deprecated": true
},
{
"name": "hoverColor",
"type": "string",
"defaultValue": "",
"description": "Color used when hovering over link"
"description": "Color used when hovering over the link."
},
{
"name": "ref",
Expand Down
1 change: 1 addition & 0 deletions src/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const StyledLink = styled.a<StyledLinkProps>`
text-decoration: none;

/* You can add one by setting underline={true} */
/** @deprecated */
dipree marked this conversation as resolved.
Show resolved Hide resolved
text-decoration: ${props => (props.underline ? 'underline' : undefined)};

/* Inline links (inside a text block), however, should have underline based on accessibility setting set in data-attribute */
Expand Down
Loading