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
safelistproperty 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>