What's the best way to get multiple CSS "outputs" using Tailwind and PostCSS? #1489
Replies: 3 comments 5 replies
-
| 
         Hey @mattkoch614! What build tools do you use currently? There are a few different approaches depending on what you're using 👍 Easiest option is Laravel Mix (ignore the name, it's a very good general purpose abstraction on top of webpack) which lets you configure separate PostCSS plugin chains for different input files in a very straightforward way: const mix = require('laravel-mix')
mix.postCss('input.css', 'output.css', [
  require('tailwindcss')('./tailwind.config.js'),
  require('autoprefixer')
])
.postCss('input.css', 'output-pdf.css', [
  require('tailwindcss')('./tailwind-pdf.config.js'),
  require('autoprefixer')
])Another option is just a few different scripts in your package.json file to run builds with separate configs using the   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         This is a separate question, but while I have you can you tell me how to override the  I can pose a separate question for it here in the Discussion.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Is there a reason the tailwind cli doesn't accept globs? Running into an issue were I'd like to read a source directory  Seems really silly to need to use another package like mix or webpack to have multiple entries.  | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all, what's the appropriate way to use PostCSS to generate two tailwind output files? Our situation is that we have our main app, which uses a highly configured tailwind.config.js file, but we also have the need to generate HTML that will be converted into a PDF. This PDF generation needs a different design system, so we want to use a separate Tailwind CSS configuration to produce a separate CSS "output." Suggestions welcome.
Beta Was this translation helpful? Give feedback.
All reactions