You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that #300 adds support for removing bin/dev and foreman, which is brilliant!
However, at present, tailwindcss-rails doesn't support multiple *tailwind.css files - the use case here is multiple different configs. I use it to set up a mailer css and a second for the default application.
Currently I have to patch in some additional commands and modify the Rake tasks as follows (I've taken this almost completely unchanged from #242):
# frozen_string_literal: true# lib/tailwindcss/commands_ext.rbmoduleTailwindcss# TailwindCSS Extension to allow multiple files to be compiled at once using the @config directivemoduleCommandsExtdefcompile_file_command(file:,debug: false, **)# rubocop:disable Metrics/MethodLength, Metrics/AbcSizefile=Pathname.new(file.to_s)input=fileoutput=Rails.root.join('app/assets/builds',file.basename.sub('tailwind.',''))config=input.open(&:readline).start_with?('@config') ? nil : Rails.root.join('config/tailwind.config.js')[executable(**),'-i',input.to_s,'-o',output.to_s].tapdo |command|
command << '-c'ifconfigcommand << config.to_sifconfigcommand << '--minify'unlessdebugendenddefwatch_file_command(poll: false, **)compile_file_command(**).tapdo |command|
command << '-w'command << '-p'ifpollendendendendTailwindcss::Commands.extend(Tailwindcss::CommandsExt)
I'm not sure what the best approach would be to get this functionality into the gem, but I'm certain it wouldn't be exactly as patched above, and for it to be viable, it would need to work in a way that the puma plugin could also support.
I'd be happy to have a go at a PR given some direction, but also welcome any discussion around this.
The text was updated successfully, but these errors were encountered:
I noticed that #300 adds support for removing bin/dev and foreman, which is brilliant!
However, at present, tailwindcss-rails doesn't support multiple *tailwind.css files - the use case here is multiple different configs. I use it to set up a mailer css and a second for the default application.
Currently I have to patch in some additional commands and modify the Rake tasks as follows (I've taken this almost completely unchanged from #242):
My
mailer.tailwind.css
looks like:and similarly,
tailwind.tailwind.css
:With their appropriate configs as described.
I'm not sure what the best approach would be to get this functionality into the gem, but I'm certain it wouldn't be exactly as patched above, and for it to be viable, it would need to work in a way that the puma plugin could also support.
I'd be happy to have a go at a PR given some direction, but also welcome any discussion around this.
The text was updated successfully, but these errors were encountered: