-
Notifications
You must be signed in to change notification settings - Fork 1
⚙️Setting: cn utils #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
14fa8ac
8efef54
840370f
f69045a
8a3d94c
8a89476
557bee9
d6ce1b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,9 @@ | |
| "eslint-config-next": "15.5.4", | ||
| "svg-sprite-loader": "^6.0.11", | ||
| "tailwindcss": "4.1.14", | ||
| "typescript": "^5" | ||
| "typescript": "^5", | ||
| "tailwind-merge": "^3.3.1", | ||
| "class-variance-authority": "^0.7.1", | ||
|
||
| "clsx": "^2.1.1" | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './utils'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import { type ClassValue, clsx } from 'clsx'; | ||
| import { extendTailwindMerge } from 'tailwind-merge'; | ||
|
|
||
| const twMerge = extendTailwindMerge({ | ||
| extend: { | ||
| theme: { | ||
| text: [ | ||
| '.text-display-lg', | ||
| '.text-display-md', | ||
| '.text-display-sm', | ||
| '.text-headline-lg', | ||
| '.text-headline-md', | ||
| '.text-headline-sm', | ||
| '.text-title-lg', | ||
| '.text-title-md', | ||
| '.text-title-sm', | ||
| '.text-label-lg', | ||
| '.text-label-md', | ||
| '.text-label-sm', | ||
| '.text-body-lg', | ||
| '.text-body-md', | ||
| '.text-body-sm', | ||
| '.text-display-serif', | ||
| '.text-headline-lg-serif', | ||
| '.text-headline-md-serif', | ||
| '.text-headline-sm-serif', | ||
| '.text-label-serif', | ||
| ], | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| color: [ | ||
| 'mint-50', | ||
| 'mint-100', | ||
| 'mint-200', | ||
| 'mint-300', | ||
| 'mint-400', | ||
| 'mint-500', | ||
| 'mint-600', | ||
| 'mint-700', | ||
| 'mint-800', | ||
| 'mint-900', | ||
| 'pink-50', | ||
| 'pink-100', | ||
| 'pink-200', | ||
| 'pink-300', | ||
| 'pink-400', | ||
| 'pink-500', | ||
| 'pink-600', | ||
| 'pink-700', | ||
| 'pink-800', | ||
| 'pink-900', | ||
| 'gray-50', | ||
| 'gray-100', | ||
| 'gray-200', | ||
| 'gray-300', | ||
| 'gray-400', | ||
| 'gray-500', | ||
| 'gray-600', | ||
| 'gray-700', | ||
| 'gray-800', | ||
| 'gray-900', | ||
| 'blue-400', | ||
| 'red-300', | ||
| 'red-400', | ||
| 'background', | ||
| 'foreground', | ||
| ], | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| export const cn = (...inputs: ClassValue[]) => { | ||
| return twMerge(clsx(inputs)); | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move runtime utilities to
dependencies.tailwind-mergeandclsxare used at runtime by thecn()utility insrc/shared/lib/utils.ts. They should be independencies, notdevDependencies, to ensure they're installed in production environments.Apply this diff to move them to
dependencies:"dependencies": { "axios": "^1.12.2", "clsx": "^2.1.1", "next": "15.5.4", "react": "19.1.0", "react-dom": "19.1.0", "react-hook-form": "^7.64.0", - "svgo": "^4.0.0" + "svgo": "^4.0.0", + "tailwind-merge": "^3.3.1" }, "devDependencies": { "@eslint/eslintrc": "^3", "@tailwindcss/postcss": "^4", "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", "eslint": "^9", "eslint-config-next": "15.5.4", "svg-sprite-loader": "^6.0.11", "tailwindcss": "4.1.14", "typescript": "^5", - "tailwind-merge": "^3.3.1", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1" + "class-variance-authority": "^0.7.1" }📝 Committable suggestion
🤖 Prompt for AI Agents