about summary refs log tree commit diff
path: root/app/helpers/style_helper.rb
blob: b695f8f3eafcbc2c5181b0064afc87ad009e4d73 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module StyleHelper
  def stylesheet_for_layout
    if asset_exist? 'custom.css'
      'custom'
    else
      'application'
    end
  end

  def asset_exist?(path)
    true if Webpacker::Manifest.lookup(path)
  rescue Webpacker::FileLoader::NotFoundError
    false
  end
end