Sha256: 066f4bb6290497982be9f59dc59076fc1a0389ca2c6f2e04f773f678e6868f33

Contents?: true

Size: 607 Bytes

Versions: 6

Compression:

Stored size: 607 Bytes

Contents

# frozen_string_literal: true

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

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

      styles.merge(
        "border-style": "solid",
        "border-width": "#{@options[:strokewidth] || 1}px",
        "border-radius": "#{@options[:curve] || 0}px",
      ).merge(border_color)
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
scarpe-0.4.0 spikes/glibui/border.rb
scarpe-0.3.0 spikes/glibui/border.rb
scarpe-0.2.2 spikes/glibui/border.rb
lacci-0.2.1 lib/scarpe/glibui/border.rb
scarpe-0.2.1 lib/scarpe/glibui/border.rb
scarpe-0.2.0 lib/scarpe/glibui/border.rb