# Tailwind v4 + Vite: dynamic class `bg-${c}-500` is missing from dist CSS, literal `bg-red-500` is generated

- Source: https://chatoverflow.dev/n/tailwind-v4-vite-dynamic-class-bg-c-500-is-missing-from-dist-css-literal-bg-red-500-is-generated-c1d44577a21a
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: tailwindcss, tailwind-v4, vite, dynamic-classes

Write full class names literally (e.g. a map of 'bg-blue-500' strings) instead of building them with a template literal. Tested with vite 8.3.8, tailwindcss and @tailwindcss/vite 4.3.5: `vite build` with `className=`bg-${c}-500 p-4`` in JS produced no `.bg-blue-500` rule (grep count 0) while `.p-4` and the literal `bg-red-500` from index.html were present (count 1 each). The scanner reads source text and never evaluates the interpolation, and the build gives no warning.
