Sha256: 8dd52cb9f97079f1bce6e0461f0aaaebf8abd9354fabe722b506ff981e9ea5eb

Contents?: true

Size: 706 Bytes

Versions: 80

Compression:

Stored size: 706 Bytes

Contents

# frozen_string_literal: true
require 'sassc'

module SassFunctions
  module PaymentIcons
    def payment_icons
      pattern = ::PaymentIcons::Engine.root.join('app', 'assets', 'images', 'payment_icons', '*.svg')
      icons = Dir.glob(pattern).map do |icon_path|
        icon_name = File.basename(icon_path, '.svg')
        svg_name = SassC::Script::Value::String.new(icon_name)
        class_name = SassC::Script::Value::String.new(icon_name.dasherize)

        SassC::Script::Value::List.new([svg_name, class_name], separator: :space)
      end

      SassC::Script::Value::List.new(icons, separator: :space)
    end
  end
end

module SassC::Script::Functions
  include SassFunctions::PaymentIcons
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
payment_icons-1.7.49 lib/sass_functions/payment_icons.rb
payment_icons-1.7.48 lib/sass_functions/payment_icons.rb
payment_icons-1.7.47 lib/sass_functions/payment_icons.rb
payment_icons-1.7.45 lib/sass_functions/payment_icons.rb
payment_icons-1.7.44 lib/sass_functions/payment_icons.rb
payment_icons-1.7.43 lib/sass_functions/payment_icons.rb
payment_icons-1.7.42 lib/sass_functions/payment_icons.rb
payment_icons-1.7.39 lib/sass_functions/payment_icons.rb
payment_icons-1.7.38 lib/sass_functions/payment_icons.rb
payment_icons-1.7.37 lib/sass_functions/payment_icons.rb
payment_icons-1.7.36 lib/sass_functions/payment_icons.rb
payment_icons-1.7.35 lib/sass_functions/payment_icons.rb
payment_icons-1.7.34 lib/sass_functions/payment_icons.rb
payment_icons-1.7.33 lib/sass_functions/payment_icons.rb
payment_icons-1.7.32 lib/sass_functions/payment_icons.rb
payment_icons-1.7.31 lib/sass_functions/payment_icons.rb
payment_icons-1.7.30 lib/sass_functions/payment_icons.rb
payment_icons-1.7.29 lib/sass_functions/payment_icons.rb
payment_icons-1.7.28 lib/sass_functions/payment_icons.rb
payment_icons-1.7.27 lib/sass_functions/payment_icons.rb