tailwindlabs / tailwindcss-setup-examples

674 stars 173 forks source link

Sourcemaps not working #55

Open pikeas opened 4 years ago

pikeas commented 4 years ago

Tested by cloning and running the Next.js example.

Screen Shot 2020-02-18 at 13 14 28

Clicking through to utilities.css:1 shows:

Screen Shot 2020-02-18 at 13 14 48

Is there a way to see Tailwind's CSS declarations in a source map for local dev and debugging?

adamwathan commented 4 years ago

There actually is no CSS source for Tailwind’s utilities, they are all generated dynamically in JS during build based on your config. So a source map would just be pointing to a bunch of loops in a JS file somewhere, hah.

Any particular problem you’re having that made you open this issue? Maybe can help solve it in another way.

pikeas commented 4 years ago

@adamwathan Thanks for the quick reply!

I haven't used Tailwind in a long while, so I'm pretty rusty on the various classes. When iterating on a frontend design, source maps in-browser are a much tighter loop than dipping out to documentation.

Tailwind generates CSS as its final output - would it be possible to treat this as the source map, or does PostCSS preclude that?

pikeas commented 4 years ago

If source maps are impossible, it would be great to call this out in the installation docs - I spent a half day trying to figure out why TW's source maps weren't working.