-
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.
Merge pull request #6 from dscnitrourkela/typography-colors
feat: add typographies and colours
- Loading branch information
Showing
12 changed files
with
209 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"tailwindCSS.experimental.classRegex": [ | ||
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"], | ||
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"] | ||
] | ||
} |
Binary file not shown.
Binary file not shown.
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 @@ | ||
export * from './typography'; |
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,21 @@ | ||
import { cva } from 'class-variance-authority'; | ||
import { cn } from '../../../lib/utils'; | ||
|
||
const headingVariants = cva(['font-syne', 'font-bold', 'text-left', 'leading-7.5'], { | ||
variants: { | ||
variant: { | ||
h1: ['text-10xl', 'leading-15'], | ||
h2: ['text-3.5xl'], | ||
h3: ['text-2xl'], | ||
}, | ||
}, | ||
}); | ||
|
||
export default function Heading({ variant = 'h1', className, children, ...props }) { | ||
const Tag = variant; | ||
return ( | ||
<Tag className={cn(headingVariants({ variant, className }))} {...props}> | ||
{children} | ||
</Tag> | ||
); | ||
} |
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,21 @@ | ||
import { cva } from 'class-variance-authority'; | ||
import { cn } from '../../../lib/utils'; | ||
|
||
const paragraphVariants = cva(['font-syne', 'text-left', 'leading-7.5', 'font-medium'], { | ||
variants: { | ||
variant: { | ||
body1: ['text-3.5xl', 'leading-9', 'font-semibold'], | ||
body2: ['text-2xl'], | ||
body3: ['text-lg'], | ||
}, | ||
}, | ||
defaultVariants: ['text-2xl'], | ||
}); | ||
|
||
export default function Paragraph({ variant = 'body2', className, children, ...props }) { | ||
return ( | ||
<p className={cn(paragraphVariants({ variant, className }))} {...props}> | ||
{children} | ||
</p> | ||
); | ||
} |
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,21 @@ | ||
import { cva } from 'class-variance-authority'; | ||
import { cn } from '../../../lib/utils'; | ||
|
||
const textVariants = cva(['font-syne', 'text-left', 'font-medium'], { | ||
variants: { | ||
variant: { | ||
button: ['font-semibold', 'text-xl', 'leading-6'], | ||
nav: ['text-lg', 'leading-6'], | ||
navButton: ['text-xl', 'leading-6', 'font-bold'], | ||
footer: ['text-xl', 'leading-5', 'font-prompt'], | ||
}, | ||
}, | ||
}); | ||
|
||
export default function Text({ variant, className, children, ...props }) { | ||
return ( | ||
<p className={cn(textVariants({ variant, className }))} {...props}> | ||
{children} | ||
</p> | ||
); | ||
} |
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,21 @@ | ||
import { cn } from '../../../lib/utils'; | ||
|
||
export { default as Heading } from './Heading'; | ||
export { default as Paragraph } from './Paragraph'; | ||
export { default as Text } from './Text'; | ||
|
||
export const HeroText = ({ children, className, ...props }) => { | ||
return ( | ||
<h1 className={cn('text-12.5xl leading-16 font-semibold font-agoka text-left', className)} {...props}> | ||
{children} | ||
</h1> | ||
); | ||
}; | ||
|
||
export const PersonalizedText = ({ children, className, ...props }) => { | ||
return ( | ||
<p className={cn('text-base leading-4 font-semibol font-cassandra text-left', className)} {...props}> | ||
{children} | ||
</p> | ||
); | ||
}; |
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,7 +1,31 @@ | ||
import { Heading, HeroText, Paragraph, PersonalizedText, Text } from '../components/shared'; | ||
|
||
export default function Playground() { | ||
return ( | ||
<div className='container py-6'> | ||
<h1 className='text-3xl font-bold'>Playground</h1> | ||
<HeroText>Hero Text</HeroText> | ||
<PersonalizedText>Personalized Text</PersonalizedText> | ||
<Heading variant='h1'>Heading 1</Heading> | ||
<Heading variant='h2'>Heading 2</Heading> | ||
<Heading variant='h3'>Heading 3</Heading> | ||
<Paragraph variant='body1'>Paragraph body1</Paragraph> | ||
<Paragraph variant='body2'>Paragraph body2</Paragraph> | ||
<Paragraph variant='body3'>Paragraph body3</Paragraph> | ||
<Text variant='button'>Text button</Text> | ||
<Text variant='nav'>Text nav</Text> | ||
<Text variant='navButton'>Text navButton</Text> | ||
<Text variant='footer'>Text footer</Text> | ||
|
||
<Heading variant='h1' className='mt-6'> | ||
Colors | ||
</Heading> | ||
<ul> | ||
<li className='text-primary'>Primary</li> | ||
<li className='text-primary-foreground'>Primary Foreground</li> | ||
<li className='text-primary-yellow'>Primary Yellow</li> | ||
<li className='text-black'>Black</li> | ||
<li className='text-black-foreground'>Black Foreground</li> | ||
</ul> | ||
</div> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"rewrites": [ | ||
{ | ||
"source": "/(.*)", | ||
"destination": "/index.html" | ||
} | ||
] | ||
} |