-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link: export linkStyles to allow styling React Router Links
- Loading branch information
1 parent
90368c3
commit 5d1c479
Showing
4 changed files
with
40 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { css } from "styled-components"; | ||
|
||
export type TextSize = "xs" | "sm" | "md" | "lg"; | ||
export type TextWeight = "normal" | "medium" | "semibold" | "bold"; | ||
|
||
export type StyledLinkProps = { $size: TextSize; $weight: TextWeight }; | ||
|
||
export const linkStyles = css<StyledLinkProps>` | ||
font: ${({ $size, $weight = "normal", theme }) => | ||
theme.typography.styles.product.text[$weight][$size]}; | ||
color: ${({ theme }) => theme.click.global.color.text.link.default}; | ||
margin: 0; | ||
text-decoration: none; | ||
display: inline-flex; | ||
gap: ${({ $size, theme }) => | ||
$size === "xs" || $size === "sm" | ||
? theme.click.link.space.sm.gap | ||
: theme.click.link.space.md.gap}; | ||
margin-right: ${({ $size, theme }) => | ||
$size === "xs" || $size === "sm" | ||
? theme.click.link.space.sm.gap | ||
: theme.click.link.space.md.gap}; | ||
align-items: center; | ||
&:hover, | ||
&:focus { | ||
color: ${({ theme }) => theme.click.global.color.text.link.hover}; | ||
transition: ${({ theme }) => theme.transition.default}; | ||
text-decoration: underline; | ||
cursor: pointer; | ||
} | ||
&:visited { | ||
color: ${({ theme }) => theme.click.global.color.text.link.default}; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters