In this video, we look at the right way to add Tailwind CSS to a Gatsby site. First we install Tailwind CSS and make a button with its utility classes.
gatsby build and
gatsby serve we view the page source to see that all the Tailwind CSS classes have been included, which is very bad!
gatsby-plugin-purgecss to our Gatsby site to remove any CSS that we aren't using, which keeps our final file size small and pretty!
After that's all in place, I explore how we can make a re-useable Button component by passing in Props and Tailwind CSS classes.
Subscribe if you liked this video!:
Follow Me On: