Skip to content

Commit

Permalink
docs(www): update installation of Astro (#1958)
Browse files Browse the repository at this point in the history
- The latest version of Astro generates `tailwind.config.mjs` file instead of `tailwind.config.cjs`.
- The `index.astro` file is located in `/src/pages`.
  • Loading branch information
jsparkdev authored Nov 19, 2023
1 parent 1903eb9 commit 6f30502
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/www/content/docs/components/form.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ npm install @radix-ui/react-label @radix-ui/react-slot react-hook-form @hookform

Define the shape of your form using a Zod schema. You can read more about using Zod in the [Zod documentation](https://zod.dev).

```tsx showLineNumbers {4,6-8}
```tsx showLineNumbers {3,5-7}
"use client"

import * as z from "zod"
Expand All @@ -137,7 +137,7 @@ const formSchema = z.object({

Use the `useForm` hook from `react-hook-form` to create a form.

```tsx showLineNumbers {4,14-20,22-27}
```tsx showLineNumbers {3-4,14-20,22-27}
"use client"

import { zodResolver } from "@hookform/resolvers/zod"
Expand Down
12 changes: 6 additions & 6 deletions apps/www/content/docs/installation/astro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ 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? › › ./src/styles/globals.css
Do you want to use CSS variables for colors? › no / yes
Where is your tailwind.config.js located? › tailwind.config.cjs
Where is your tailwind.config.js located? › tailwind.config.mjs
Configure the import alias for components: › @/components
Configure the import alias for utils: › @/lib/utils
Are you using React Server Components? › no
```

### Import the globals.css file

Import the `globals.css` file in the `src/index.astro` file:
Import the `globals.css` file in the `src/pages/index.astro` file:

```ts {2} showLineNumbers
---
Expand All @@ -127,12 +127,12 @@ export default defineConfig({
})
```

### Update tailwind.config.cjs
### Update tailwind.config.mjs

When running `npx shadcn-ui@latest init`, your tailwind config for content will be overwritten. To fix this, change the `content` section with the code below to your `tailwind.config.cjs` file:
When running `npx shadcn-ui@latest init`, your tailwind config for content will be overwritten. To fix this, change the `module.exports` to `export default` and the `content` section with the code below to your `tailwind.config.mjs` file:

```js {2-4} showLineNumbers
module.exports = {
```js {1-4} showLineNumbers
export default {
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
}
```
Expand Down

1 comment on commit 6f30502

@vercel
Copy link

@vercel vercel bot commented on 6f30502 Nov 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./apps/www

ui-shadcn-pro.vercel.app
example-playground.vercel.app
ui-git-main-shadcn-pro.vercel.app
ui.shadcn.com

Please sign in to comment.