Class: RailsAppGenerator::AddOns::MinimalCss

Inherits:
RailsAppGenerator::Addon show all
Defined in:
lib/rails_app_generator/addons/minimal_css.rb

Overview

Add MinimalCss to rails application

Constant Summary collapse

LIBRARIES =
{
  water: {
    source: 'https://watercss.kognise.dev',
    content: '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">'
  },
  picnic: {
    source: 'https://picnicss.com',
    content: '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/picnic">'
  },
  chota: {
    source: 'https://jenil.github.io/chota/',
    content: '<link rel="stylesheet" href="https://unpkg.com/chota@latest">'
  }
}.freeze

Instance Attribute Summary

Attributes inherited from RailsAppGenerator::Addon

#context, #dependencies, #gem_entries

Instance Method Summary collapse

Methods inherited from RailsAppGenerator::Addon

addon_name, dependencies, depends_on, gem, gem_entries, #initialize, required_gem, reset_gem_entries

Constructor Details

This class inherits a constructor from RailsAppGenerator::Addon

Instance Method Details

#after_bundleObject



53
54
55
56
57
# File 'lib/rails_app_generator/addons/minimal_css.rb', line 53

def after_bundle
  library_key = (options[:minimal_css_library] || 'water').to_sym

  insert_into_file 'app/views/layouts/application.html.erb', head(library_key), before: %r{^\s+</head>}, force: true
end

#applyObject



51
# File 'lib/rails_app_generator/addons/minimal_css.rb', line 51

def apply; end