Reputation: 319
I can't seem to get TailwindCSS @apply to work. Visual Studio Code doesn't seem to recognise my code.
.btn {
@apply mb-2 bg-purple-600 text-gray-100 font-bold p-3 rounded;
}
Upvotes: 2
Views: 1373
Reputation: 2235
Write it all in one line:
.btn {
@apply mb-2 bg-purple-600 text-gray-100 font-bold p-3 rounded;
}
I hope it helps.
Upvotes: 1
Reputation: 44
No tailwind class names you defined in the apply command '.' you don't need to put it.
As a solution, write all tailwind elements in one line.
.btn {
@apply mb-2 bg-purple-600 text-gray-100 font-bold p-3 rounded;
}
Upvotes: 2