I'm wondering how to handle dynamically generated CSS class names in a blade template. I want to use Tailwind, and stick to the conventions/examples, etc.
I'm using the latest Laravel (9.28 at the time of the question). Let's say I have a div such as this:
<div draggable='true' class="mx-2 bg-green-{{ $level }}">Item</div>
OR
<div class="grid-cols-{{ $number_of_days }}">
And the possible $level values, based on the blade loop/logic are 300 or 500 (for instance), and $number_of_days can be like 5 or 7 (again, these are both just examples of classes that will be dynamically chosen by code)
When I npm run build, because the bg-green-300 or bg-green-500 (or grid-cols-5 and grid-cols-7) are never explicitly mentioned in the blade template, apparently, the classes for those are never added to the resulting CSS.
Am I approaching this entirely the wrong way or am I missing something in the build/vite config?