How to show rendered color with tailwind and larval blade

Issue

This Content is from Stack Overflow. Question asked by Mondy

Into a blade file I want to past the background color from a variable to the script, 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 shown?

Thanks for help.



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?