Sha256: 1871358a99a70de16f77b62cf869fe4a39a5d554341fe851c092002396cbe627

Contents?: true

Size: 380 Bytes

Versions: 11

Compression:

Stored size: 380 Bytes

Contents

# frozen_string_literal: true

class Scarpe
  class Dimensions
    class << self
      def length(value)
        case value
        when Integer
          if value < 0
            "calc(100% - #{value.abs}px)"
          else
            "#{value}px"
          end
        when Float
          "#{value * 100}%"
        else
          value
        end
      end
    end
  end
end

Version data entries

11 entries across 7 versions & 3 rubygems

Version Path
scarpe-0.4.0 spikes/glibui/dimensions.rb
scarpe-0.3.0 spikes/glibui/dimensions.rb
scarpe-0.2.2 lib/scarpe/wv/dimensions.rb
scarpe-0.2.2 spikes/glibui/dimensions.rb
scarpe-wasm-0.1.0 lib/scarpe/wasm/dimensions.rb
lacci-0.2.1 lib/scarpe/glibui/dimensions.rb
lacci-0.2.1 lib/scarpe/wv/dimensions.rb
scarpe-0.2.1 lib/scarpe/wv/dimensions.rb
scarpe-0.2.1 lib/scarpe/glibui/dimensions.rb
scarpe-0.2.0 lib/scarpe/wv/dimensions.rb
scarpe-0.2.0 lib/scarpe/glibui/dimensions.rb