Sha256: 5e8ec38e1ea8c5229dd68e19181f40345e1443e3e02ccf5d1cde2c43fc2f048f

Contents?: true

Size: 936 Bytes

Versions: 5

Compression:

Stored size: 936 Bytes

Contents

module Archetype::Functions::CSS

  private

  #
  # given a set of related properties, compute the property value
  #
  # *Parameters*:
  # - <tt>hsh</tt> {Hash} the hash of styles
  # - <tt>property</tt> {String} the original property we're looking for
  # *Returns*:
  # - {Hash} the derived styles
  #
  def self.get_derived_styles_via_router(hsh, property)
    base = get_property_base(property)
    handler = "get_derived_styles_router_for_#{base}"
    # if we don't need any additional processing, stop here
    return nil if not self.respond_to?(handler)
    base = /^#{base}/
    value = self.method(handler).call(hsh.select { |key, value| key =~ base }, property)
    value = value[normalize_property_key(property)] if value.is_a?(Hash)
    return value
  end
end

%w(animation background border list margin_padding outline overflow target transition).each do |router|
  require "archetype/functions/css/routers/#{router}"
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
archetype-1.0.0.alpha.5 lib/archetype/functions/css/routers.rb
archetype-1.0.0.alpha.4 lib/archetype/functions/css/routers.rb
archetype-1.0.0.alpha.3 lib/archetype/functions/css/routers.rb
archetype-1.0.0.alpha.2 lib/archetype/functions/css/routers.rb
archetype-1.0.0.alpha.1 lib/archetype/functions/css/routers.rb