Sha256: 5841ba87943dacafa00223bdf625837c052be85ce216b66494f6a2625082fabc

Contents?: true

Size: 419 Bytes

Versions: 2

Compression:

Stored size: 419 Bytes

Contents

# frozen_string_literal: true

class Scarpe
  module WebviewBackground
    def style
      styles = (super if defined?(super)) || {}
      return styles unless @background_color

      color = if @background_color.is_a?(Range)
        "linear-gradient(45deg, #{@background_color.first}, #{@background_color.last})"
      else
        @background_color
      end

      styles.merge(background: color)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scarpe-0.2.1 lib/scarpe/wv/background.rb
scarpe-0.2.0 lib/scarpe/wv/background.rb