Class: StimulusPlumbers::Tailwind::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Generators::CssEntrypoint
Defined in:
lib/generators/stimulus_plumbers/tailwind/install/install_generator.rb

Constant Summary collapse

TOKENS_CSS_SOURCE =
File.join(
  Gem.loaded_specs.fetch("stimulus_plumbers").gem_dir,
  StimulusPlumbers::Generators::TokensDirective::TOKENS_CSS_PATH
)
ANIMATIONS_CSS_SOURCE =
File.join(
  File.expand_path("../../../../../", __dir__),
  AnimationsDirective::ANIMATIONS_CSS_PATH
)

Instance Method Summary collapse

Instance Method Details

#installObject



24
25
26
27
28
29
30
31
32
# File 'lib/generators/stimulus_plumbers/tailwind/install/install_generator.rb', line 24

def install
  css_file = entry_css_file(**css_file_lookup_options)
  return warn_entry_css_not_found(label: "Tailwind CSS", **css_file_lookup_options) unless css_file
  return unless copy_assets

  apply_tokens_directive(css_file)
  apply_animations_directive(css_file)
  apply_sources_directive(css_file)
end