Skip to content

[CLI] Inconsistent CSS file location when adding Tailwind CSS via npx sv add vs initial setup #809

@SikandarJODD

Description

@SikandarJODD

Describe the bug

There is an inconsistency in the CSS file name and location depending on when Tailwind CSS is added to a SvelteKit project:

Scenario 1: Tailwind selected during initial setup

  • When selecting Tailwind CSS as an option during npx sv create folder-name
  • Result: Creates app.css in the src/ folder

Scenario 2: Tailwind added after initial setup

  • When adding Tailwind CSS later using npx sv add tailwindcss
  • Result: Creates layout.css in the src/routes/ folder

Reproduction

To reproduce Scenario 1:

npx sv create folder-name
# Select Tailwind CSS during prompts
cd folder-name
# Observe: src/app.css exists

To reproduce Scenario 2:

npx sv create folder-name
# Do NOT select Tailwind CSS during prompts
cd folder-name
npx sv add tailwindcss
# Observe: src/routes/layout.css exists instead

Logs

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12450H
    Memory: 3.88 GB / 15.70 GB
  Binaries:
    Node: 22.17.1 - C:\Program Files\nodejs\node.EXE
    npm: 11.0.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.12.3 - C:\Users\sikandar\AppData\Roaming\npm\pnpm.CMD
    bun: 1.3.0 - C:\Users\sikandar\.bun\bin\bun.EXE

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions