2025年9月3日
3 分钟阅读

Remix + tailwind + shadcn

Remix 全栈框架部署和引入tailwind

Remix + tailwind + shadcn

install remix

bash
npx create-remix@latest

install tailwind

bash
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

bash
bunx --bun shadcn-ui@latest init
bash
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
javascript
# postcss.config.ts export default { plugins: { tailwindcss: {}, autoprefixer: {}, }, }
评论区 (0)
你的临时ID:
暂无评论,来发表第一条评论吧!