Class: Schienenzeppelin::AddOns::StimulusComponents
- Inherits:
-
Schienenzeppelin::AddOn
- Object
- Rails::Generators::Base
- Schienenzeppelin::AddOn
- Schienenzeppelin::AddOns::StimulusComponents
- Defined in:
- lib/schienenzeppelin/addons/stimulus_components.rb
Instance Attribute Summary
Attributes inherited from Schienenzeppelin::AddOn
Instance Method Summary collapse
Methods inherited from Schienenzeppelin::AddOn
apply, default_source_root, dependencies, get, identifier, #initialize
Constructor Details
This class inherits a constructor from Schienenzeppelin::AddOn
Instance Method Details
#apply ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/schienenzeppelin/addons/stimulus_components.rb', line 8 def apply run('yarn add tailwindcss-stimulus-components') inject_into_file('app/javascript/packs/application.js') do <<~JS import { Application } from "stimulus" import { definitionsFromContext } from "stimulus/webpack-helpers" const application = Application.start(); const context = require.context("controllers", true, /.js$/); application.load(definitionsFromContext(context)); import { Dropdown, Modal, Tabs, Popover, Toggle, Slideover } from "tailwindcss-stimulus-components" application.register('dropdown', Dropdown) application.register('modal', Modal) application.register('tabs', Tabs) application.register('popover', Popover) application.register('toggle', Toggle) application.register('slideover', Slideover) JS end end |