A Gatsby plugin is a Node package that uses the Gatsby APIs under the hood.
You can use a plugin to source data into your site, transform content or enhance the output of your site like adding google analytics etc...
Gatsby plugins can be categorized into 3 types:
Install a plugin you can run the command npm install plugin-name
e.g npm install gatsby-plugin-postcss
.
Add the plugin to your gatsby-config.js
file
In this lesson, you learn how to use gatsby-plugin-postcss to add tailwindcss support to your project
Instructor: [0:00] First, let's install tailwindcss as a dev dependency. After that, we need to install the gatsby-plugin-postcss. Let's go to our project and create a gatsby-config.js. In there, let's add our new plugin. Next, let's create a postcss.config.js file and add tailwind as a plugin.
[0:40] Finally, inside of src, let's create a CSS folder. Inside of that, let's create an index.css file. Let's add the tailwind base. Let's go to our components inside the flyout. Since this is used in every page, we can import our CSS in here.
[0:58] Here we will simply import the index.css file. Let's hit Save and run our server. You can see here, the CSS has changed and this is using tailwind.
Member comments are a way for members to communicate, interact, and ask questions about a lesson.
The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io
Be on-Topic
Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.
Avoid meta-discussion
Code Problems?
Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context
Details and Context
Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!