Diagnostic step 1
Replace runtime template literals with a mapping object of allowed class strings (e.g., const sizeClass = {sm:'text-sm', md:'text-md'}; class={sizeClass[size]}) or conditional class: directives in Svelte to make classes static.
Generated Oct 26, 2026, 9:23:15 AM
Replace runtime template literals with a mapping object of allowed class strings (e.g., const sizeClass = {sm:'text-sm', md:'text-md'}; class={sizeClass[size]}) or conditional class: directives in Svelte to make classes static.
Add an explicit safelist block in tailwind.config.js for the dynamic patterns you need (use specific lists or precise regexes) and rebuild to verify.
Configure Tailwind's content extractor to include preprocessed output if your build chain alters source before scanning, or adjust Svelte preprocess order so Tailwind sees raw templates.
As a temporary check, add concrete classes in markup to confirm the issue is purge-related, then remove after applying a safer long-term pattern.
Avoid relying on arbitrary runtime string concatenation for utility names; prefer bracket notation only when values are known at build time.