Skip to content

Commit 2bc8d65

Browse files
authored
Merge pull request #3 from internshipsamyrai44/add-pallete-and-typography
feat: tailwind pallete and typography, fix: button styles
2 parents 4b44f85 + 886c700 commit 2bc8d65

File tree

5 files changed

+150
-9
lines changed

5 files changed

+150
-9
lines changed

src/components/button/button.module.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
}
88

99
.root.primary {
10-
@apply text-white bg-blue-300;
10+
@apply text-light-100 bg-accent-700;
1111
}
1212

1313
.root.secondary {
14-
@apply text-blue-400 bg-gray-400;
14+
@apply text-accent-700 bg-light-500;
1515
}
1616

1717
.root:focus-visible {
18-
@apply outline outline-2 outline-blue-400;
18+
@apply outline outline-2 outline-accent-100;
1919
}
2020

21-
.root.fullwidth {
21+
.root.full-width {
2222
@apply justify-center w-1;
2323
}

src/components/button/button.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useRef } from 'react'
1+
import React, { useRef } from 'react'
22

33
import { Meta, StoryObj } from '@storybook/react'
44

src/components/button/button.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ import s from './button.module.css'
77

88
type Props = {
99
asChild?: boolean
10-
fullwidth?: boolean
10+
fullWidth?: boolean
1111
variant?: 'ghost' | 'outlined' | 'primary' | 'secondary'
1212
} & ComponentPropsWithoutRef<'button'>
1313

1414
export const Button = forwardRef<ElementRef<'button'>, Props>(
15-
({ asChild, className, fullwidth, variant = 'primary', ...props }, ref) => {
15+
({ asChild, className, fullWidth, variant = 'primary', ...props }, ref) => {
1616
const Comp = asChild ? Slot : 'button'
1717

1818
return (
1919
<Comp
2020
{...props}
21-
className={clsx(s.root, s[variant], fullwidth && s.fullwidth, className)}
21+
className={clsx(s.root, s[variant], fullWidth && s.fullWidth, className)}
2222
ref={ref}
2323
/>
2424
)

src/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@import 'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,400..700;1,14..32,400..700&display=swap';
2+
13
@tailwind base;
24
@tailwind components;
35
@tailwind utilities;
6+

tailwind.config.js

Lines changed: 139 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,146 @@
11
/** @type {import('tailwindcss').Config} */
2+
3+
const plugin = require('tailwindcss/plugin')
4+
25
export default {
36
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
4-
plugins: [],
7+
plugins: [
8+
plugin(({ addBase, theme }) => {
9+
addBase({
10+
a: { color: theme('colors.accent.500') },
11+
html: { color: theme('colors.dark.900') },
12+
})
13+
}),
14+
],
515
theme: {
16+
colors: {
17+
accent: {
18+
100: '#73A5FF',
19+
300: '#4C8DFF',
20+
500: '#397DF6',
21+
700: '#2F68CC',
22+
900: '#234E99',
23+
},
24+
current: 'currentColor',
25+
danger: {
26+
100: '#FF8099',
27+
300: '#F23D61',
28+
500: '#CC1439',
29+
700: '#990F2B',
30+
900: '#660A1D',
31+
},
32+
dark: {
33+
100: '#4C4C4C',
34+
300: '#333333',
35+
500: '#171717',
36+
700: '#0D0D0D',
37+
900: '#000000',
38+
},
39+
light: {
40+
100: '#FFFFFF',
41+
300: '#F7FBFF',
42+
500: '#EDF3FA',
43+
700: '#D5DAE0',
44+
900: '#8D9094',
45+
},
46+
success: {
47+
100: '#80FFBF',
48+
300: '#22E584',
49+
500: '#14CC70',
50+
700: '#0F9954',
51+
900: '#0A6638',
52+
},
53+
transparent: 'transparent',
54+
warning: {
55+
100: '#FFD073',
56+
300: '#E5AC39',
57+
500: '#D99000',
58+
700: '#996600',
59+
900: '#664400',
60+
},
61+
},
662
extend: {},
63+
fontFamily: {
64+
sans: ['Inter', 'sans-serif'],
65+
},
66+
fontSize: {
67+
bold_14: [
68+
'0.875rem',
69+
{
70+
fontWeight: '700',
71+
lineHeight: '1.5rem',
72+
},
73+
],
74+
bold_16: [
75+
'1rem',
76+
{
77+
fontWeight: '700',
78+
lineHeight: '1.5rem',
79+
},
80+
],
81+
h1: [
82+
'1.25rem',
83+
{
84+
fontWeight: '700',
85+
lineHeight: '2.25rem',
86+
},
87+
],
88+
h2: [
89+
'1.125rem',
90+
{
91+
fontWeight: '700',
92+
lineHeight: '1.5rem',
93+
},
94+
],
95+
h3: [
96+
'1rem',
97+
{
98+
fontWeight: '600',
99+
lineHeight: '1.5rem',
100+
},
101+
],
102+
large: [
103+
'1.625rem',
104+
{
105+
fontWeight: '600',
106+
lineHeight: '2.25rem',
107+
},
108+
],
109+
medium_14: [
110+
'0.875rem',
111+
{
112+
fontWeight: '500',
113+
lineHeight: '1.5rem',
114+
},
115+
],
116+
regular_14: [
117+
'0.875rem',
118+
{
119+
fontWeight: '400',
120+
lineHeight: '1.5rem',
121+
},
122+
],
123+
regular_16: [
124+
'1rem',
125+
{
126+
fontWeight: '400',
127+
lineHeight: '1.5rem',
128+
},
129+
],
130+
'semi-bold_small': [
131+
'0.75rem',
132+
{
133+
fontWeight: '600',
134+
lineHeight: '1rem',
135+
},
136+
],
137+
small: [
138+
'0.75rem',
139+
{
140+
fontWeight: '400',
141+
lineHeight: '1rem',
142+
},
143+
],
144+
},
7145
},
8146
}

0 commit comments

Comments
 (0)