Sha256: e58fef0712e42199d21a24c3dcf2fd3086c138b65efba64fec18ebbf1431aa69

Contents?: true

Size: 470 Bytes

Versions: 1

Compression:

Stored size: 470 Bytes

Contents

# frozen_string_literal: true

module TNS
  module Output
    # Output a given color as SASS variable.
    class SASS
      def initialize(name)
        @name = name
      end

      def format(palette)
        palette
          .map { |variant| format_variant(variant) }
          .map { |string| "#{string};" }
          .join("\n")
      end

      def format_variant(variant)
        "$#{@name}-#{variant.index * 100}: #{variant.to_css}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tints-n-shades-0.1.0 lib/tns/output/sass.rb