May 2022
Intermediate to advanced
104 pages
2h 24m
English
Tailwind plugins are just snippets of JavaScript that you can define that allow you to insert your own additional classes, patterns, and prefixes to your Tailwind app. They are actually simple enough that you can insert them inline in your Tailwind configuration file.
To start, you need to require the plugin function by putting this line at the top of your tailwind.config.js file:
| | const plugin = require("taiwindcss/plugin") |
Then, inside the configuration itself, you can call that plugin function. The argument to plugin is a function.
| | const plugin = require("taiwindcss/plugin") |
| | |
| | module.exports = { |
| | content: ["./html/*.html"], |
| | theme: { |
| | extend: {}, |
| | }, |
| | plugins: [ |
| | plugin(({}) => { |
| | }) |
| | ], |
| | }; |
The anonymous function ...
Read now
Unlock full access