-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: removes global TW styles (#80)
- Loading branch information
Bryce Kalow
authored
Apr 12, 2023
1 parent
3aef406
commit 25ac52f
Showing
9 changed files
with
144 additions
and
29 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
packages/swingset-theme-hashicorp/src/components/heading.tsx
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,32 @@ | ||
import { type HTMLAttributes } from 'react' | ||
import { cx, cva } from 'class-variance-authority' | ||
|
||
type HeadingProps = HTMLAttributes<HTMLHeadingElement> & { | ||
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | ||
} | ||
|
||
const headingStyles = cva('m-0 p0', { | ||
variants: { | ||
as: { | ||
h1: 'ss-text-3xl', | ||
h2: 'ss-text-2xl', | ||
h3: 'ss-text-xl', | ||
h4: 'ss-text-lg', | ||
h5: 'ss-text-md', | ||
h6: 'ss-text-md', | ||
}, | ||
}, | ||
defaultVariants: { | ||
as: 'h2', | ||
}, | ||
}) | ||
|
||
export function Heading({ as = 'h2', className, ...restProps }: HeadingProps) { | ||
const Component = as | ||
return ( | ||
<Component | ||
className={cx(headingStyles({ as }), className)} | ||
{...restProps} | ||
/> | ||
) | ||
} |
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,16 @@ | ||
import { type ComponentProps } from 'react' | ||
import NextLink from 'next/link' | ||
import { cx } from 'class-variance-authority' | ||
|
||
type NextLinkProps = ComponentProps<typeof NextLink> | ||
|
||
export type LinkProps = NextLinkProps & { className?: string } | ||
|
||
export function Link({ className, ...restProps }: LinkProps) { | ||
return ( | ||
<NextLink | ||
className={cx('ss-text-blue-500 ss-underline', className)} | ||
{...restProps} | ||
/> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,25 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
||
@layer base { | ||
h1 { | ||
@apply ss-text-3xl; | ||
} | ||
|
||
h2 { | ||
@apply ss-text-2xl; | ||
} | ||
|
||
h3 { | ||
@apply ss-text-xl; | ||
} | ||
|
||
h4 { | ||
@apply ss-text-lg; | ||
} | ||
|
||
a { | ||
@apply ss-text-blue-500 ss-underline; | ||
} | ||
} |
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
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