Skip to content

Commit

Permalink
Merge branch 'link-styles' into figma-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
kof committed Jan 4, 2024
2 parents 08c489f + 5334e7f commit 6be3673
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 4 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions packages/design-system/src/components/link.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { linkStyle } from "./link";
import { StorySection, StoryGrid } from "./storybook";

export default {
title: "Library/Link",
};

export const Link = () => (
<>
<StorySection title="Variants">
<StoryGrid
css={{
alignItems: "flex-start",
}}
>
<a className={linkStyle()} href="">
Regular
</a>
<a className={linkStyle({ variant: "label" })} href="">
Label
</a>
<a className={linkStyle({ variant: "mono" })} href="">
Mono
</a>
</StoryGrid>
</StorySection>
<StorySection title="Colors">
<StoryGrid
css={{
alignItems: "flex-start",
}}
>
<a className={linkStyle()} href="">
Main
</a>
<a className={linkStyle({ color: "contrast" })} href="">
Contrast
</a>
<a className={linkStyle({ color: "subtle" })} href="">
Subtle
</a>
<a className={linkStyle({ color: "moreSubtle" })} href="">
More Subtle
</a>
</StoryGrid>
</StorySection>
</>
);
28 changes: 28 additions & 0 deletions packages/design-system/src/components/link.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { css, theme } from "../stitches.config";
import { textVariants } from "./text";

export const linkStyle = css({
color: theme.colors.foregroundLink,
"&:hover": { color: theme.colors.foregroundLinkHoverMain },
"&:visited": {
color: theme.colors.foregroundLink,
},
variants: {
variant: {
regular: textVariants.regularLink,
label: textVariants.labelLink,
mono: textVariants.monoLink,
},
color: {
contrast: {
color: theme.colors.foregroundContrastMain,
"&:hover": { color: theme.colors.foregroundLinkHoverContrast },
},
subtle: { color: theme.colors.foregroundLinkHoverTextSubtle },
moreSubtle: { color: theme.colors.foregroundLinkHoverTextMoreSubtle },
},
},
defaultVariants: {
variant: "regular",
},
});

0 comments on commit 6be3673

Please sign in to comment.