But it is not working. So I put the function on the top of the blade file, and call that function, and it works. I would prefer to have that function separated, but ok. But then i change the switch to match function, to its more elegant, but de colors didn't work properly with the match function, just one color worked.
Hello there.
I have a function in a Service file called getBlendColor, something like this:
And i'm calling it inside a blade file like this:
But it is not working. So I put the function on the top of the blade file, and call that function, and it works. I would prefer to have that function separated, but ok. But then i change the switch to match function, to its more elegant, but de colors didn't work properly with the match function, just one color worked.
So, 2 questions:
Simply add a path to your php file in
tailwind.config.jsfile, so Tailwind knows which files to look for class names. Example:Make sure you're always using complete class names and not constructing them dynamically: Dynamic class names.
Thanks for the reply. I tried this, but it doesn't work for some how. I tried both below and run npm run dev and npm run build: