文章 / 前端与体验 / Remix + tailwind + shadcn

Remix + tailwind + shadcn

Remix 全栈框架部署和引入tailwind

2024年5月21日4 min946 words
Remix + tailwind + shadcn
图 1-1 cover.webp

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)

加载评论中...
RELATED NOTES
05 entries
01给 AI Agent 设计可靠的发布系统:幂等、断点续跑与跨平台一致性阅读文章 →02react漏洞阅读文章 →03rust编译成wasm反而比纯js慢阅读文章 →04mcp服务的node实现阅读文章 →05编程规范阅读文章 →