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 all 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 @@ -10,6 +10,7 @@ import {ForwardRefComponent as PolymorphicForwardRefComponent} from '../utils/po
type StyledLinkProps = {
hoverColor?: string
muted?: boolean
/** @deprecated use `inline` to specify the type of link instead */
underline?: boolean
// Link inside a text block
inline?: boolean
Expand Down
Loading