Move custom tailwind plugins out of tailwind.js file
See original GitHub issueIssue
Description
We have several custom plugins inside tailwind.js
file, let’s move them out from there to src/theme/plugins
.
Once they are in different files we should import them and add it to tailwind.js
like this:
plugins: [
require('tailwindcss/plugins/container')({
// center: true,
// padding: '1rem',
}),
require('src/theme/plugins/panel')(),
require('src/theme/plugins/diagonalbg')(),
// etc...
],
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Configuration - Tailwind CSS
The plugins section allows you to register plugins with Tailwind that can be used to generate extra utilities, components, base styles, or custom...
Read more >Restructuring my tailwind.js configuration files - Oliver Davies
Currently when you run tailwind init to create a new config file, it includes all of Tailwind's default values, and then you can...
Read more >Write A Plugin For Tailwind CSS - Egghead.io
In this tutorial, we'll build a Tailwind CSS plugin. Utility-first frameworks like Tailwind can't include every CSS style due to size concerns, ...
Read more >How To Write A Plugin For Tailwind CSS - Nick Basile
A step-by-step walkthrough on building a Tailwind CSS plugin and uploading it to NPM.
Read more >The complete guide to customizing a Tailwind CSS theme
The complete tutorial on creating a custom Tailwind CSS theme, ... The file tailwind.config.js is used for Tailwind CSS theme customization.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not programming test. I just want to see it run before making my PR. Thanks very much @tureey
@klazbaba based on the error and the source code you are showing… it looks to me that the problem might be the way you are exporting inside each plugin.
Without seeing that code it’s difficult to asses, but maybe you don’t need the extra
()
in each require, try just this:In order to test all you have to do is
yarn start
and the app should load as usual.yarn start
does everything for you (compiles css, extracts i18n files, compiles i18n files, etc…).