79777935

Date: 2025-09-29 09:18:27
Score: 0.5
Natty:
Report link

The syntax you want to use was only introduced in v4.1, so earlier versions don't include it.

From TailwindCSS v4.1.0 onwards

With this feature, now have the ability to include critically important classes in the compiled CSS using a syntax similar to the safelist property from v3.

# Force update to TailwindCSS v4.1 with CLI plugin
npm install tailwindcss@^4.1 @tailwindcss/cli@^4.1

# Force update to TailwindCSS v4.1 with PostCSS plugin
npm install tailwindcss@^4.1 @tailwindcss/postcss@^4.1

# Force update to TailwindCSS v4.1 with Vite plugin
npm install tailwindcss@^4.1 @tailwindcss/vite@^4.1

Reproduction in Play CDN:

<!-- At least v4.1 is required! -->
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/[email protected]"></script>
<style type="text/tailwindcss">
@source inline("{hover:,}bg-red-{50,{100..900..100},950}");
</style>

<div class="text-3xl bg-red-100 hover:bg-red-900">
  Hello World
</div>

Reasons:
  • Blacklisted phrase (1): is it possible to
  • Blacklisted phrase (1): Is it possible to
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • High reputation (-2):
Posted by: rozsazoltan