2025年9月3日
3 分钟阅读
Remix + tailwind + shadcn
Remix 全栈框架部署和引入tailwind

install remix
bashnpx create-remix@latest
install tailwind
bashnpm 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
bashbunx --bun shadcn-ui@latest init
bashWould 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)
暂无评论,来发表第一条评论吧!