-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Documentation for using Tailwind with Gatsby #10898
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments from me. I feel like CSS-in-JS should also be given some exposure as I personally use CSS-in-JS 100% of the time now and using Tailwind with the babel macro is really easy
docs/docs/tailwind-css.md
Outdated
plugins: [`gatsby-plugin-postcss`], | ||
``` | ||
|
||
3. Add a PostCSS Config File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this step be bundled with step 6? Step 6 just would tell the user to create the file with the following contents
docs/docs/tailwind-css.md
Outdated
|
||
`npm install tailwindcss --save-dev` | ||
|
||
5. Generate Tailwind Config File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5. Generate Tailwind Config File | |
5. Generate Tailwind config file |
docs/docs/tailwind-css.md
Outdated
|
||
5. Generate Tailwind Config File | ||
|
||
To configure Tailwind, we'll need to add a Tailwind configuration file. Luckily, Tailwind has a built-in script to do this. Just run the following command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To configure Tailwind, we'll need to add a Tailwind configuration file. Luckily, Tailwind has a built-in script to do this. Just run the following command: | |
To configure Tailwind, you'll need to add a Tailwind configuration file. Luckily, Tailwind has a built-in script to do this. Just run the following command: |
docs/docs/tailwind-css.md
Outdated
./node_modules/.bin/tailwind init | ||
` | ||
|
||
6. Configure PostCSS to Use Tailwind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6. Configure PostCSS to Use Tailwind | |
6. Configure PostCSS to use Tailwind |
docs/docs/tailwind-css.md
Outdated
}) | ||
``` | ||
|
||
7. Use the Tailwind Directives in Your CSS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7. Use the Tailwind Directives in Your CSS | |
7. Use the Tailwind directives in your CSS |
docs/docs/tailwind-css.md
Outdated
|
||
### Other resources | ||
|
||
- [Introduction to postcss](https://www.smashingmagazine.com/2015/12/introduction-to-postcss/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [Introduction to postcss](https://www.smashingmagazine.com/2015/12/introduction-to-postcss/) | |
- [Introduction to PostCSS](https://www.smashingmagazine.com/2015/12/introduction-to-postcss/) |
Also food for thought, I would recommend adding in how to use it with PurgeCSS since Tailwind generates so much CSS and the end user likely will only use a small portion of what was generated. |
Co-Authored-By: jakedohm <jake.dohm@me.com>
Co-Authored-By: jakedohm <jake.dohm@me.com>
I think I'm going to re-structure the article like so: Tailwind Installation & Configuration
Using Tailwind
Since the you have to install and configure Tailwind for both methods, I think it makes sense to only do that stuff in one place, and then show them how to implement either method. Does that sound good to you @LekoArts? @hagnerd I'll also add instructions for how to enable PurgeCSS! |
Yeah, sounds good! |
Hey @jakedohm, wanted to check where you were on this? More and more people are asking about Gatsby and Tailwind so would be great to get this in if you're able to finish it up! |
This looks great, thanks @jakedohm! I'll add a follow-up PR adding this to the docs hierarchy! |
Holy buckets, @jakedohm — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
* Added doc for using Tailwind with Gatsby * Add link to Tailwind Co-Authored-By: jakedohm <jake.dohm@me.com> * Update docs/docs/tailwind-css.md Co-Authored-By: jakedohm <jake.dohm@me.com> * Updating to include both PostCSS and CSS-in-JS setup
Description
I added a document with a walkthrough of how to get Tailwind CSS up and running with Gatsby via PostCSS. Based on: https://dev.to/jakedohm_34/using-tailwind-with-gatsby-js-10fj
Let me know if anything is missing, or any corrections need to be made!