I have created a Strapi v4 plugin but I don’t want to use Strapi design system for my UI (I have create other plugins with Strapi design system]). I want to use tailwindcss
I have created tailwind.config.js and styles.css following installation docs and import them in /plugins/[plugin-folder]/admin/src/index.js of my plugin without any success.
Also tried add tailwindcss in /src/admin/webpack.config.js at config.plugins without success again.
Looking into the same thing. I’ll post back if I am able to find a solution. Really don’t want to have to learn a new design system in order to build custom admin panels
I was able to get this working by using the Tailwind CLI to compile a global.css and the compiled version into my plugin.
I’m planning on returning to this issue when I have more time to dedicate to integrating with Strapi’s Webpack build, but for now I can just run CLI in watch while developing.
Sure, you should be able to follow the TailwindCSS CLI Installation. Specifically, take note of how they have an input.css which is all the files that are being passed in and the output.css is the file being loaded into the project.
For our case, we’ll want to import our compiled output.css into our Strapi Application on the “admin” side of things e.g.
One benefit of scaffolding out a new plugin to house and compile the CSS is it keeps all things tailwind consolidated in one place. Inside of the plugin’s package.json I have the following script targets setup.
I’ll use the npm run develop:tailwind when I’m working on the Strapi application so that the CLI tool continually watches/regenerates the output.css based on the classes I’m adding inside Strapi.
Let me know if this makes sense or if I could add further clarification anywhere!