$> npx shadcn@latest init
Run the shadcn-ui init command to setup your project: ...
omitelo por ahora...sh npm i autoprefixer
astro.config.mjs
, remueve la integration de tailwind //Ejemplo:
import { defineConfig } from 'astro/config';
import react from "@astrojs/react";
// https://astro.build/config
export default defineConfig({
integrations: [react()]
});
postcss.config.cjs
debe lucir algo como: module.exports = {
plugins: {
tailwindcss: {},
'@pandacss/dev/postcss': {},
autoprefixer: {}
}
};
panda.config.ts
: layers: {},
tailwind.config.ts
agregando esto: corePlugins: {
preflight: false,
}
index.css
en el src (src/index.css) debe lucir algo como esto: @tailwind base;
@tailwind components;
@tailwind utilities;
@layer reset, base, tokens, recipes, utilities;
/* if you decide to rename layers, you can use it like below */
/* @layer panda_reset, panda_base, panda_tokens, panda_recipes, panda_utilities; */
npx astro add tailwind
dando Yes a todo lo que surjatsconfig.json
luciendo algo como: {
"compilerOptions": {
// ...
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}
// ...
}
}
npx shadcn-ui@latest init
yes
Default
Slate
.src/styles/global.css
yes
<<blank>>
tailwind.config.mjs
@/components
@/lib/utils
no
yes
tailwind.config.js
y otro tailwind.config.mjs
, ambos solo asegurate tengan el: corePlugins: { preflight: false }
Si es necesario borra el tailwind.config.mjsm de igual forma no hay problema, asi como el global.css. Tambien asegurate que tailwind.config.js
sea export default { ... }
El archivo postcss.config.cjs
permanece igual:
module.exports = {
plugins: {
tailwindcss: {},
'@pandacss/dev/postcss': {},
autoprefixer: {}
}
};
astro.config.mjs
luzca como: import { defineConfig } from 'astro/config';
import react from "@astrojs/react";
// https://astro.build/config
export default defineConfig({
integrations: [react()]
});
npx shadcn-ui@latest add button
---
import '../index.css'
import { css } from '../../styled-system/css';
import { Button } from '@/components/ui/button';
---
<h1 class={ css({ fontSize: '4xl', fontWeight: 'bold' }) }>Panda</h1>
<h1 class="text-3xl font-bold">Tailwind</h1>
<Button>Shadcn</Button>
npm run prepare
y para ver el sitio con npm run dev