Skip to content

Commit

Permalink
Update River and SectionIntro default link colors to blue (#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
rezrah authored Nov 5, 2024
1 parent 774b91b commit 6331ae6
Show file tree
Hide file tree
Showing 42 changed files with 27 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .changeset/tough-lobsters-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@primer/react-brand': minor
---

`River` and `SectionIntro` link colors now default to blue (accent) for consistency with `Card`, `Pillar` and similar components that feature blue links.

:warning: This is a visual breaking change. Please manually review all usages of `River` and `SectionIntro` to ensure there is sufficient contrast with the background color.
4 changes: 1 addition & 3 deletions packages/react/src/Bento/Bento.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export const Default = () => (
Push what's possible with GitHub Copilot, the world's most trusted and widely adopted AI developer
tool.
</Bento.Heading>
<Link href="#" variant="default">
Learn more about Copilot
</Link>
<Link href="#">Learn more about Copilot</Link>
</Bento.Content>
</Bento.Item>
</Bento>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 15 additions & 7 deletions packages/react/src/SectionIntro/SectionIntro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,21 @@ function _Label({children, ...rest}: PropsWithChildren<SectionIntroLabelProps>)

type SectionIntroLinkProps = Omit<LinkProps, 'size'> & BaseProps<HTMLAnchorElement>

const _Link = forwardRef(({className, children, ...props}: SectionIntroLinkProps, ref: Ref<HTMLAnchorElement>) => {
return (
<Link ref={ref} className={clsx(styles['SectionIntro-link'], className)} size="medium" {...props}>
{children}
</Link>
)
})
const _Link = forwardRef(
({className, children, variant = 'accent', ...props}: SectionIntroLinkProps, ref: Ref<HTMLAnchorElement>) => {
return (
<Link
ref={ref}
className={clsx(styles['SectionIntro-link'], className)}
size="medium"
variant={variant}
{...props}
>
{children}
</Link>
)
},
)

export const SectionIntro = Object.assign(Root, {
Heading: _Heading,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion packages/react/src/river/River/River.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ export const RiverContent = forwardRef(
)}
{React.isValidElement(LinkChild) && (
<div className={styles['River__call-to-action']}>
{React.cloneElement(LinkChild as React.ReactElement<LinkProps>, {size: 'medium'})}
{React.cloneElement(LinkChild as React.ReactElement<LinkProps>, {
size: 'medium',
variant: LinkChild.props.variant || 'accent',
})}
</div>
)}
{TrailingComponent && (
Expand Down

0 comments on commit 6331ae6

Please sign in to comment.