@@ -36,92 +36,95 @@ export default function Design(): React.JSX.Element {
3636 </ div >
3737 < p className = 'mt-2 text-secondary' > Font Family: Inter</ p >
3838 < ul className = 'mt-3 grid grid-cols-[repeat(auto-fit,minmax(256px,1fr))] gap-4' >
39- { colorPalette . map ( ( { title, hexCode, className } ) => (
40- < li className = 'flex items-center gap-2' key = { title } >
41- < div
42- className = { clsx ( 'main-border h-10 w-10 rounded-md' , className ) }
43- />
44- < div >
45- < h3 > { title } </ h3 >
46- < p className = 'text-sm text-muted' > { hexCode } </ p >
47- </ div >
48- </ li >
49- ) ) }
39+ { colorPalette . map ( ( { title, className, lightHex, darkHex } ) => {
40+ let parsedHex : string ;
41+
42+ if ( ! darkHex ) parsedHex = lightHex ;
43+ else {
44+ if ( theme === 'dark' ) parsedHex = darkHex ;
45+ else parsedHex = lightHex ;
46+ }
47+
48+ return (
49+ < li className = 'flex items-center gap-2' key = { title } >
50+ < div
51+ className = { clsx (
52+ 'main-border h-10 w-10 rounded-md' ,
53+ className
54+ ) }
55+ />
56+ < div >
57+ < h3 > { title } </ h3 >
58+ < p className = 'text-sm text-muted' > { parsedHex } </ p >
59+ </ div >
60+ </ li >
61+ ) ;
62+ } ) }
5063 </ ul >
5164 </ motion . section >
5265 </ main >
5366 ) ;
5467}
5568
56- const colorPalette = [
57- {
58- title : 'White Background' ,
59- hexCode : '#ffffff' ,
60- className : 'bg-white'
61- } ,
62- {
63- title : 'Black Background' ,
64- hexCode : '#222222' ,
65- className : 'bg-black'
66- } ,
67- {
68- title : 'White Text' ,
69- hexCode : '#ffffff' ,
70- className : 'bg-white'
71- } ,
72- {
73- title : 'Black Text' ,
74- hexCode : '#000000' ,
75- className : 'bg-black'
76- } ,
77- {
78- title : 'Gray 100 Text' ,
79- hexCode : '#f3f4f6' ,
80- className : 'bg-gray-100'
81- } ,
69+ type ColorPalette = {
70+ title : string ;
71+ darkHex ?: string ;
72+ lightHex : string ;
73+ className : string ;
74+ } ;
75+
76+ const colorPalette : ColorPalette [ ] = [
8277 {
83- title : 'Gray 200 Text' ,
84- hexCode : '#e5e7eb' ,
85- className : 'bg-gray-200'
78+ title : 'Background' ,
79+ className : 'bg-background' ,
80+ lightHex : '#ffffff' ,
81+ darkHex : '#000000'
8682 } ,
8783 {
88- title : 'Gray 300 Text' ,
89- hexCode : '#d1d5db' ,
90- className : 'bg-gray-300'
84+ title : 'Foreground' ,
85+ className : 'bg-foreground' ,
86+ lightHex : '#000000' ,
87+ darkHex : '#ffffff'
9188 } ,
9289 {
93- title : 'Gray 400 Text' ,
94- hexCode : '#9ca3af' ,
95- className : 'bg-gray-400'
90+ title : 'Primary' ,
91+ className : 'bg-primary' ,
92+ lightHex : '#111827' ,
93+ darkHex : '#f3f4f6'
9694 } ,
9795 {
98- title : 'Gray 500 Text' ,
99- hexCode : '#6b7280' ,
100- className : 'bg-gray-500'
96+ title : 'Secondary' ,
97+ className : 'bg-secondary' ,
98+ lightHex : '#1f2937' ,
99+ darkHex : '#e5e7eb'
101100 } ,
102101 {
103- title : 'Gray 600 Text' ,
104- hexCode : '#4b5563' ,
105- className : 'bg-gray-600'
102+ title : 'Muted' ,
103+ className : 'bg-muted' ,
104+ lightHex : '#4b5563' ,
105+ darkHex : '#9ca3af'
106106 } ,
107107 {
108- title : 'Gray 700 Text' ,
109- hexCode : '#374151' ,
110- className : 'bg-gray-700'
108+ title : 'Border' ,
109+ className : 'bg-border' ,
110+ lightHex : '#d1d5db' ,
111+ darkHex : '#374151'
111112 } ,
112113 {
113- title : 'Gray 800 Text' ,
114- hexCode : '#1f2937' ,
115- className : 'bg-gray-800'
114+ title : 'Muted background' ,
115+ className : 'bg-muted-background' ,
116+ lightHex : '#f3f4f6' ,
117+ darkHex : '#111827'
116118 } ,
117119 {
118- title : 'Gray 900 Text' ,
119- hexCode : '#111827' ,
120- className : 'bg-gray-900'
120+ title : 'Accent foreground' ,
121+ className : 'bg-accent-foreground' ,
122+ lightHex : '#9ca3af' ,
123+ darkHex : '#4b5563'
121124 } ,
122125 {
123- title : 'Gradient Color ' ,
124- hexCode : '#a855f7 to #f472b6 ' ,
125- className : 'bg-gradient-to-tr from-accent-start to-accent-end '
126+ title : 'Gradient color ' ,
127+ className : 'bg-gradient-to-tr from-accent-start to-accent-end ' ,
128+ lightHex : '#a855f7 to #c084fc '
126129 }
127- ] as const ;
130+ ] ;
0 commit comments