Title: create: scaffold's unlayered body styles defeat its own @layer base rules (and any shadcn theme) · Issue #511 · TanStack/cli · GitHub
Open Graph Title: create: scaffold's unlayered body styles defeat its own @layer base rules (and any shadcn theme) · Issue #511 · TanStack/cli
X Title: create: scaffold's unlayered body styles defeat its own @layer base rules (and any shadcn theme) · Issue #511 · TanStack/cli
Description: Which project does this relate to? Create Tanstack App Describe the bug The generated src/styles.css has an unlayered body rule that permanently defeats the @layer base { body { … } } rule further down in the same file. @import 'tailwind...
Open Graph Description: Which project does this relate to? Create Tanstack App Describe the bug The generated src/styles.css has an unlayered body rule that permanently defeats the @layer base { body { … } } rule further ...
X Description: Which project does this relate to? Create Tanstack App Describe the bug The generated src/styles.css has an unlayered body rule that permanently defeats the @layer base { body { … } } rule further ...
Opengraph URL: https://github.com/TanStack/cli/issues/511
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"create: scaffold's unlayered body styles defeat its own @layer base rules (and any shadcn theme)","articleBody":"### Which project does this relate to?\n\nCreate Tanstack App\n\n### Describe the bug\n\nThe generated `src/styles.css` has an unlayered `body` rule that permanently defeats the `@layer base { body { … } }` rule further down in the same file.\n\n`@import 'tailwindcss'` sets up `@layer theme, base, components, utilities`. Unlayered CSS outranks all layered CSS, so in a fresh scaffold:\n\n```css\n/* line 166 — unlayered → wins */\nbody {\n margin: 0;\n color: var(--sea-ink);\n font-family: var(--font-sans);\n background-color: var(--bg-base);\n background: radial-gradient(...);\n}\n\n/* line 339 — layered → can never take effect */\n@layer base {\n body {\n background-color: var(--background);\n color: var(--foreground);\n }\n}\n```\n\nThe `@layer base` block is dead code as shipped — `--background` and `--foreground` never reach `body`.\n\nThis becomes a functional bug with the shadcn add-on. `shadcn apply --preset \u003ccode>` writes its theme into those same custom properties, so applying any preset from ui.shadcn.com/create has no visible effect:\n\n- `--background` / `--foreground` lose to `--bg-base` / `--sea-ink`\n- the preset's font loses too — presets emit `@layer base { html { @apply font-serif } }`, which the unlayered `body { font-family: var(--font-sans) }` (line 169) overrides\n- `a { color: var(--lagoon-deep) }` (line 208, unlayered) overrides the theme's link colour\n\nThe CLI prints \"Preset applied successfully.\", the values written are correct, and the build passes. The page just doesn't change. Reproduces with `apply \u003ccode>`, `--only theme`, and `--only theme,font`.\n\n### Your Example Website or App\n\nN/A — this is a `create` scaffolding bug. It happens when the project is generated, so there's no app to link. See Steps to Reproduce.\n\n### Steps to Reproduce the Bug or Issue\n\n```bash\nnpx @tanstack/cli@latest create demo \\\n --framework react --non-interactive --add-ons shadcn \\\n --no-examples --package-manager npm --toolchain eslint --no-git --no-intent\n\ncd demo\n\n# any preset code from https://ui.shadcn.com/create\nnpx shadcn@latest apply --preset b5VsmmRNAG -y\n\nnpm run build\ngrep -o \"body{[^}]*}\" dist/client/assets/styles-*.css\n```\n\nActual output — four `body` rules, the shadcn one first and losing to three unlayered ones:\n\n```css\nbody{background-color:var(--background);color:var(--foreground)} /* @layer base — loses */\nbody{color:var(--sea-ink);background-color:var(--bg-base);background:radial-…} /* unlayered — wins */\nbody{background:radial-gradient(…)} /* unlayered — wins */\nbody{-webkit-font-smoothing:antialiased;overflow-x:hidden} /* unlayered */\n```\n\nVisually: the page renders the scaffold's teal/green palette and Manrope, not the selected preset's palette and font.\n\n### Expected behavior\n\nThe `@layer base` rules the template itself ships should be able to take effect,\nand an applied shadcn preset should govern the page's colours and font.\n\nConcretely: after `shadcn apply`, `body` should resolve to the preset's\n`--background` / `--foreground`, and the preset's font should apply — instead of\nbeing silently overridden by the scaffold's own unlayered decorative rules.\n\n### Screenshots or Videos\n\n_No response_\n\n### Platform\n\nOS: macOS 27.0 (build 26A428), Darwin 27.0.0, arm64\nNode: 24.14.1\nnpm: 11.16.0\n@tanstack/cli: 0.71.0\n@tanstack/create: 0.70.0\nshadcn: 4.21.0\ntailwindcss: 4.1.18\nvite: 8.0.0\nreact: 19.2.0\n\n### Additional context\n\n_No response_","author":{"url":"https://github.com/mishucodes","@type":"Person","name":"mishucodes"},"datePublished":"2026-09-16T19:47:15Z","url":"https://github.com/TanStack/cli/issues/511"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d6a2b3ea-30d8-878f-44ff-4cc7f82cee20 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EAD8:33FBDD:2535535:30F9012:6AF99E3B |
| html-safe-nonce | 48cab35a983895b6003c05378dbd2fb787aef6481a87ab3e66fd43c430180569 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUQ4OjMzRkJERDoyNTM1NTM1OjMwRjkwMTI6NkFGOTlFM0IiLCJ2aXNpdG9yX2lkIjoiNDA1NjYwOTgxNDU2OTAzNzQwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 03bde6c783e3c15aa05341188b27185d6ba8604cdab757e64c6fc077404a50b3 |
| hovercard-subject-tag | issue:5479197151 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TanStack/cli/511/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9f839c7f75b5427c039dd79adfb749d6e230259d23eef34f4e1257052d1c9e16/TanStack/cli/issues/511 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9f839c7f75b5427c039dd79adfb749d6e230259d23eef34f4e1257052d1c9e16/TanStack/cli/issues/511 |
| og:image:alt | Which project does this relate to? Create Tanstack App Describe the bug The generated src/styles.css has an unlayered body rule that permanently defeats the @layer base { body { … } } rule further ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mishucodes |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/TanStack/cli git https://github.com/TanStack/cli.git |
| octolytics-dimension-user_id | 72518640 |
| octolytics-dimension-user_login | TanStack |
| octolytics-dimension-repository_id | 932949058 |
| octolytics-dimension-repository_nwo | TanStack/cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 932949058 |
| octolytics-dimension-repository_network_root_nwo | TanStack/cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width