question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After Following Official Docs Exactly, Tailwind with Gatsby Doesn't Work

See original GitHub issue

What version of Tailwind CSS are you using?

For example: v3.1.8

What build tool (or framework if it abstracts the build tool) are you using?

For example: postcss 8.4.16

What version of Node.js are you using?

For example: v16.15.1

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

Ah the classic 30 minute i’ll-do-the-work-for-basic-documentation-failure, but ok here it is:

https://github.com/princefishthrower/gatsby-tailwind-bug

It’s a gatsby ‘hello world’ clone with the steps applied from the official tailwind docs: https://tailwindcss.com/docs/guides/gatsby

Describe your issue

Styles aren’t applied, again, following the official docs with just an <h1> tag:

<h1 className="text-3xl font-bold underline">
        Hello world!
      </h1>

(but I did add text-tahiti for good measure; no change; what do I expect?)

You can clearly see the <h1> rendered does not have an underline and not with tahiti color

Sorry for my grumbly demeanor, this is the fourth library in 4 days (quite literally) that has failed me after following documented steps to the T. It’s getting frustrating.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

41reactions
adamwathancommented, Sep 7, 2022

Hey, the instructions work fine, you just didn’t follow them.

You completely missed this step:

image

…and you created your global.css file in the wrong folder, you put it into src/pages instead of src.

image

Ah the classic 30 minute i’ll-do-the-work-for-basic-documentation-failure

Zero patience for this sort of bullshit dude. Get a better attitude or get the fuck out of here.

13reactions
adamwathancommented, Sep 7, 2022

Here’s a PR that configures your project as per the documentation:

https://github.com/princefishthrower/gatsby-tailwind-bug/pull/1/files

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docs: Tailwind CSS configuration with Gatsby is missing some ...
After following the installation guide, when running the project the build fails because Gatsby is not able to find the tailwind.config.js ...
Read more >
Install Tailwind CSS with Gatsby
Using npm, install tailwindcss and its peer dependencies, as well as gatsby-plugin-postcss , and then run the init command to generate both ...
Read more >
Using Gatsby with Tailwind CSS: A tutorial with examples
To show how Gatsby and Tailwind CSS work together, this tutorial walks you through the process of building a simple health and fitness...
Read more >
How to get Tailwind.css working with Gatsby.js? - Stack Overflow
The build: scripts will run Sass + PostCSS (without the watch tasks) + PurgeCSS (in that order). Add the following to layouts/index.js to...
Read more >
Tailwind not working when deploying to Gatsby Cloud - Reddit
I tried to deploy a website in Gatsby Cloud but as after it was built and deployed the design got messed up. I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found