tailwindlabs / tailwindcss-typography

Beautiful typographic defaults for HTML you don't control.
https://tailwindcss-typography.vercel.app/
MIT License
4.68k stars 269 forks source link

Prose class not generated when using SASS #282

Closed azzamsa closed 2 years ago

azzamsa commented 2 years ago

What version of @tailwindcss/typography are you using?

v0.5.4

What version of Node.js are you using?

v18.7.0

What browser are you using?

Firefox 103.0.2

What operating system are you using?

Debian GNU/Linux 11 (bullseye)

Reproduction repository

https://github.com/azzamsa/mwe/tree/tailwind-prose/src/js/eleventy

Describe your issue

I thought the root cause was custom color, Turns out, the prose class doesn't generated when I migrate from CSS to SASS.

Before:

image

After moving to SASS in this commit: https://github.com/azzamsa/mwe/commit/57b730c78d66dd9a708946396b193813512ebac8

image

Related:

adamwathan commented 2 years ago

Hey! This doesn't look Tailwind related, your entire stylesheet isn't loading at all because Eleventy is trying to import an SCSS file directly in the browser which won't work:

image

Changing it to <link href="/styles/index.css"> instead of scss seems to work 👍

image
azzamsa commented 2 years ago

Finally, found the root cause.

Spent a valid day to figure it out. I want to introduce prose to my already huge blog. the class is not generated. So I created MWE. It works all the time with smaller code. So I begin removing everything in my blog to find the root cause. Turns out it is just one line change.

@@ -12,6 +12,6 @@ module.exports = {
       mono: ["Victor Mono"],
     },
-    plugins: [],
   },
+    plugins: [require("@tailwindcss/typography")],
 };

My plugin key was inside theme block for years, but TailwindCSS never complaints about it. Do TailwindCSS has mechanism to validate the configuration?, if this is the plan, I will open a ticket.

Thanks a lot for TailwindCSS.