@wendyhamel
Posted
Hi, I think the problem is that the classes do not show up in the HTML. Tailwind looks for the classes you are actually using in your project. In your tailwind config file, you include content: ["./index.html", "script.js"]' but the script file is actually calles
script.ts` So Tailwind doesn't see these classes when building for production.
I don't see why you need the separate hover classes with @apply. Or for the a
tags? You could just do this with Tailwind classes in the HTML and adding the custom color and box-shadow in the tailwind config file by extending the theme. Or am I missing something?
Happy coding!
Marked as helpful
@invictus1032
Posted
@wendyhamel Ahh, right. I didn't include script.ts
because tsc
will compile it to script.js
anyway, and that's what the browser uses. Now that you mention it, I realized that the build script consisted of building the css first, and the js second. Now it all makes sense because the script.js
didn't exist when tailwind was compiling the css. So, I just simply swapped the build orders and now everything worked as expected. Thanks a lot, man!
@invictus1032
Posted
@wendyhamel
"I don't see why you need the separate hover classes with @apply."
Sorry, i don't quite understand what do you mean. I didn't use @apply
for the hover class. I just used regular css. As for why I did it with utility class instead of extending the theme, I just find it more convenient, because it's not like I'll need to use the box-shadow again.
As for the a
's utility class, there are 2 a
elements on the footer and I don't like repeating what I write.
@wendyhamel
Posted
@invictus1032 Ah, not I get it! That makes sense.
@wendyhamel
Posted
@invictus1032 Glad my comment was of use to you.