Sha256: b0ea16fafc6984ad4d595c414a2c6b8c1d17799095f1eb1d9d6f55468e616955

Contents?: true

Size: 750 Bytes

Versions: 3

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true

require 'rails/generators'

module Underlay
  class StylesheetBaseGenerator < Rails::Generators::Base
    source_root File.expand_path(
      File.join('..', '..', '..', 'templates'),
      File.dirname(__FILE__)
    )

    def add_css_config
      copy_file(
        'application.scss',
        'app/assets/stylesheets/application.scss',
        force: true
      )
    end

    def add_flashes_css
      copy_file(
        '_flashes.scss',
        'app/assets/stylesheets/partials/_flashes.scss',
        force: true
      )
    end

    def remove_prior_config
      remove_file 'app/assets/stylesheets/application.css'
    end

    def install_normalize_css
      run 'bin/yarn add normalize.css'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
underlay-2.0 lib/underlay/generators/stylesheet_base_generator.rb
underlay-1.52.1 lib/underlay/generators/stylesheet_base_generator.rb
underlay-1.50.1 lib/underlay/generators/stylesheet_base_generator.rb