Skip to content

Conversation

@SpacePlushy
Copy link

Summary

Fixes #8542 - Adds clarification to Vite installation docs about CSS transformation during the init process.

Problem

Users following the Vite installation guide were seeing components with missing or bugged styling. The documentation instructed users to set up @import "tailwindcss"; in their CSS file, but didn't explain that the npx shadcn@latest init command automatically adds CSS variables, theme configuration, and base styles to this file.

This left users with incomplete CSS when they didn't realize the init command should have modified their file, or when the init process failed silently.

Changes Made

1. Added clarification callout after CSS import step

  • Explains that @import "tailwindcss"; is the correct Tailwind CSS v4 way
  • Notes that the init command will automatically enhance this file

2. Added "Verify your CSS file" section after init step

  • Shows the complete CSS structure users should see after running init
  • Includes full example with CSS variables, dark mode config, @theme inline, and @layer base
  • Helps users verify their setup is correct before proceeding

3. Added transformation explanation

  • Lists what each part of the CSS adds (CSS Variables, Dark Mode Support, Theme Mapping, Base Styles)
  • Provides context for what the init command does

4. Added troubleshooting guidance

  • Warning callout if CSS variables are missing
  • Suggests re-running init command

Files Changed

  • apps/www/content/docs/installation/vite.mdx - Added clarification and verification sections
  • apps/v4/content/docs/installation/vite.mdx - Same updates for consistency

Testing

  • Documentation syntax verified and formatted with prettier
  • Changes follow existing documentation patterns
  • Both MDX files successfully processed by content layer

Impact

This documentation improvement will help users:

  • Understand what the init command does to their CSS file
  • Verify their setup is correct before adding components
  • Troubleshoot styling issues more easily
  • Follow the installation process with more confidence

🤖 Generated with Claude Code

@vercel
Copy link

vercel bot commented Oct 29, 2025

@SpacePlushy is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Contributor

Looks like this PR modifies files in apps/www, which is deprecated.

Consider applying the change to apps/v4 if relevant.

Fixes shadcn-ui#8542

The Vite installation documentation now explains that the `npx shadcn@latest init`
command automatically adds CSS variables and theme configuration to the CSS file.

Changes:
- Added callout after CSS import step explaining the init command will modify the file
- Added "Verify your CSS file" section showing the expected CSS structure after init
- Included explanatory notes about what each part of the transformation adds
- Added troubleshooting guidance if CSS variables are missing

This addresses the issue where users following the docs would see components with
missing/bugged styling because they didn't realize the init command should have
added the necessary CSS variables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: Bugged styling in React Vite project

1 participant