Sha256: 2365502f6d06a582af881b944cb9c40711d5837d477c875bc5615b4c1d894883

Contents?: true

Size: 859 Bytes

Versions: 10

Compression:

Stored size: 859 Bytes

Contents

namespace :tailwindcss do
  desc "Install Tailwind CSS into the app"
  task :install do
    system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../install/tailwindcss.rb", __dir__)}"
  end

  desc "Show the list of class names being kept in Tailwind CSS"
  task :keeping_class_names do
    puts Tailwindcss::Purger.extract_class_names_from(default_files_with_class_names)
  end

  desc "Show Tailwind CSS styles that are left after purging unused class names"
  task :preview_purge do
    puts Tailwindcss::Purger.purge tailwind_css, keeping_class_names_from_files: default_files_with_class_names
  end
end

def default_files_with_class_names
  Rails.root.glob("app/views/**/*.*") + Rails.root.glob("app/helpers/**/*.rb")
end

def tailwind_css
  Pathname.new(__FILE__).join("../../../app/assets/stylesheets/tailwind.css").read
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tailwindcss-rails-1.0.0 lib/tasks/tailwindcss_tasks.rake
tailwindcss-rails-0.5.4 lib/tasks/tailwindcss_tasks.rake
tailwindcss-rails-0.5.3 lib/tasks/tailwindcss_tasks.rake
tailwindcss-rails-0.5.2 lib/tasks/tailwindcss_tasks.rake
tailwindcss-rails-0.5.1 lib/tasks/tailwindcss_tasks.rake
tailwindcss-rails-0.5.0 lib/tasks/tailwindcss_tasks.rake
tailwindcss-rails-0.4.3 lib/tasks/tailwindcss_tasks.rake
tailwindcss-rails-0.4.2 lib/tasks/tailwindcss_tasks.rake
tailwindcss-rails-0.4.1 lib/tasks/tailwindcss_tasks.rake
tailwindcss-rails-0.4.0 lib/tasks/tailwindcss_tasks.rake