Remix + tailwind + shadcn
Remix 全栈框架部署和引入tailwind

install remix
npx create-remix@latest
install tailwind
npm install -D
tailwindcss postcss autoprefixer
npx tailwindcss init --ts
# tailwind.config.ts
content: ['./app/**/*.{js,jsx,ts,tsx}'],
# end
# tailwind.css
@tailwind base;
@tailwind components;
@tailwind utilities;
# end
# root.tsx
import stylesheet from "~/tailwind.css";
export const
inks: LinksFunction = () => [
{ rel: "stylesheet", href: stylesheet },
];
# end
install shadcn
bunx --bun shadcn-ui@latest init
Would you like to use TypeScript (recommended)? no / yes
Which style would you like to use? › Default
Which color would you like to use as base color? › Slate
Where is your global CSS file? › app/tailwind.css
Do you want to use CSS variables for colors? › no / yes
Where is your tailwind.config.js located? › tailwind.config.js
Configure the import alias for components: › ~/components
Configure the import alias for utils: › ~/lib/utils
Are you using React Server Components? › yes
# postcss.config.ts
export default {
plugins: { tailwindcss: {},
autoprefixer: {},
},
}
评论 (0)