Skip to content

Commit

Permalink
install tailwind-merge, prettier, clsx
Browse files Browse the repository at this point in the history
  • Loading branch information
rschlaefli committed Nov 26, 2024
1 parent 1ea104b commit acb6769
Show file tree
Hide file tree
Showing 5 changed files with 561 additions and 81 deletions.
4 changes: 4 additions & 0 deletions packages/tc-web/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.stencil/
docs/
loader/
node_modules/
6 changes: 6 additions & 0 deletions packages/tc-web/.prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
semi: false,
singleQuote: true,
trailingComma: 'es5',
plugins: ['prettier-plugin-organize-imports', 'prettier-plugin-tailwindcss'],
}
8 changes: 7 additions & 1 deletion packages/tc-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"scripts": {
"build": "stencil build --docs",
"dev": "stencil build --dev --watch --serve",
"format": "prettier write .",
"test": "stencil test --spec --e2e",
"test.watch": "stencil test --spec --e2e --watchAll",
"generate": "stencil generate"
Expand All @@ -26,12 +27,17 @@
"@stencil/postcss": "2.1.0",
"@stencil/sass": "2.0.0",
"@tailwindcss/aspect-ratio": "0.4.2",
"@tailwindcss/typography": "0.5.12",
"@tailwindcss/forms": "0.5.3",
"@tailwindcss/typography": "0.5.12",
"autoprefixer": "10.4.13",
"clsx": "2.1.1",
"cssnano": "5.1.14",
"ionicons": "7.4.0",
"prettier": "3.4.0",
"prettier-plugin-organize-imports": "4.0.0",
"prettier-plugin-tailwindcss": "0.6.5",
"stencil-tailwind-plugin": "1.8.0",
"tailwind-merge": "1.12.0",
"tailwindcss": "3.4.15",
"typescript": "5.7.2"
},
Expand Down
7 changes: 7 additions & 0 deletions packages/tc-web/src/util/util.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";

export function parseTags(tagsJson: string): string[] {
try {
return JSON.parse(tagsJson);
Expand All @@ -6,3 +9,7 @@ export function parseTags(tagsJson: string): string[] {
return []; // Return empty array in case of error
}
}

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
Loading

0 comments on commit acb6769

Please sign in to comment.