
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
gatsby-theme-tailwindcss
Advanced tools
A Gatsby theme to use tailwindcss.
This theme installs:
Tailwindcss and postcss are required to have tailwind properly working, emotion is installed because it is very common to use a CSS in JS framework and I think it is useful to have emotion and tailwind installed and configured to work together.
npm install --save gatsby-theme-tailwindcss
or
yarn add gatsby-theme-tailwindcss
As stated on its official documentation, inject Tailwind's styles using the @tailwind
directive:
@tailwind base;
@tailwind components;
@tailwind utilities;
You should write these 3 directives either on a css you are importing or creating a new .css
file and importing it.
I recommend creating a globals.css
file for example in a utils
folder and use it for tailwind loading directives and later extracting CSS components and / or other customisations if needed.
├── gatsby-config.js
├── node_modules
├── package.json
└── src
├── pages
│ └── index.js
└── utils
└── globals.css
NOTE: If you experience a FOUC (flash of unstyled content) when first loading pages, import the above mentioned .css
file on gatsby-browser.js
, like this:
//gatsby-browser.js
import "./src/utils/globals.css"
Add a tailwind.config.js
file at the root of your project folder in order to use the tailwind.macro for CSS in JS and to be able to customise the tailwind base styles and modifiers.
yarn tailwind init
or
npx tailwindcss init
This theme is using gatsby-plugin-postcss under the hood, so you can pass in any options you would to the actual postcss plugin (postCssPlugins and cssLoaderOptions)
NOTE: using a postcss.config.js file is not supported, you have to use the options: {} object of the theme.
Key | Default value | Description |
---|---|---|
postCssPlugins | [require("tailwindcss")] | postcss-plugins to load |
cssLoaderOptions | {} | postcss css loader options |
emotionOptions | {} | emotion babel-plugin-emotion options |
The only plugin included as default is the actual tailwindcss required to work, but I do recommend using the autoprefixer and purgeCSS plugins too.
(See it in action in the demo site)
// gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-theme-tailwindcss`,
options: {
postCssPlugins: [require("autoprefixer")],
},
},
],
}
(See it in action in the demo site)
Use the official gatsby plugin gatsby-plugin-purgecss
For more detailed info, visit the official docs at tailwindcss docs
FAQs
Gatsby Tailwind Theme
The npm package gatsby-theme-tailwindcss receives a total of 7 weekly downloads. As such, gatsby-theme-tailwindcss popularity was classified as not popular.
We found that gatsby-theme-tailwindcss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.