How to show rendered color with Tailwind and Laravel Blade

Viewed 28

I want to paste the background color from a variable to the script into a Blade file, but it does not show the color.

<span class="inline-flex items-center px-3 py-0.5 rounded-full text-sm font-medium {!! $color !!} text-green-800">

When I open the site and inspect it, it shows this:

<span class="inline-flex items-center px-3 py-0.5 rounded-full text-sm font-medium bg-yellow-600 text-green-800">abc</span>

It only works when I have the same bg-yellow-600 somewhere else hardcoded into the script.

Why won't it show?

0 Answers
Related