a generator to move the styles to app
This commit is contained in:
13
lib/generators/install/USAGE
Normal file
13
lib/generators/install/USAGE
Normal file
@ -0,0 +1,13 @@
|
||||
Description:
|
||||
Install merged, create dirs, copy initial empty data
|
||||
NOT done
|
||||
|
||||
Example:
|
||||
bin/rails generate merged:install
|
||||
|
||||
This will create:
|
||||
/merged directory for your data
|
||||
/merged/*yml empty data files
|
||||
/app/assets/images/cms for your images
|
||||
/app/assets/stylesheets/merged/tailwind_extra.css
|
||||
|
9
lib/generators/install/install_generator.rb
Normal file
9
lib/generators/install/install_generator.rb
Normal file
@ -0,0 +1,9 @@
|
||||
require "rails/generators"
|
||||
|
||||
module Merged
|
||||
module Generators
|
||||
class InstallGenerator < Rails::Generators::Base
|
||||
source_root File.expand_path("templates", __dir__)
|
||||
end
|
||||
end
|
||||
end
|
16
lib/generators/merged/update/USAGE
Normal file
16
lib/generators/merged/update/USAGE
Normal file
@ -0,0 +1,16 @@
|
||||
Description:
|
||||
Update an existing installation
|
||||
Basically copy the merged tailwind stylesheet over to the app.
|
||||
To use in a tailwind app you must split out the
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
into it's own file, and have the main entry point only include
|
||||
the base, this merged file and your own. (Because sprockets etc is not
|
||||
available and the tailwind cli only supports top level includes)
|
||||
|
||||
Example:
|
||||
bin/rails generate merged:update
|
||||
|
||||
This will overwrite:
|
||||
/app/assets/stylesheets/merged/tailwind_extra.css
|
11
lib/generators/merged/update/update_generator.rb
Normal file
11
lib/generators/merged/update/update_generator.rb
Normal file
@ -0,0 +1,11 @@
|
||||
require 'rails/generators/base'
|
||||
|
||||
module Merged
|
||||
class UpdateGenerator < Rails::Generators::Base
|
||||
source_root File.expand_path("../../../../app/assets/stylesheets", __dir__)
|
||||
|
||||
def update
|
||||
copy_file "merged_tailwind_styles.css", "app/assets/stylesheets/merged_tailwind_styles.css"
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user