Sha256: 9b2d2ccd481ee5c1548eb2ee1c57356cae69e6973bb6681eea16f0b3822d06a7

Contents?: true

Size: 846 Bytes

Versions: 99

Compression:

Stored size: 846 Bytes

Contents

@import "sprites"

get(hash, key)
  for pair in hash
    return pair[1] if pair[0] == key



sprites ?= ()



sprite(image, widget = 'default', hash = sprites)

  // test widget
  error("Widget '" + widget + "' does not exist!") unless get(hash,widget)


  // get default properties
  props = get(get(hash,widget), default)

  for pair in props
    add-property pair[0], unquote(pair[1]) unless pair[0] is null


  // get widget properties
  props = get(get(get(hash,widget),images),image)

  // test widget image
  error("Image '" + image + "' does not exist for '" + widget + "' widget!") unless props

  for pair in props

    value    = pair[1]
    property = pair[0]
    value    = unquote(value) if typeof(value) is 'string'
    add-property property, value unless value is null

  // add some other properties
  add-property display, block

Version data entries

99 entries across 99 versions & 1 rubygems

Version Path
ende-0.5.22 lib/assets/stylesheets/sprite.styl
ende-0.5.21 lib/assets/stylesheets/sprite.styl
ende-0.5.20 lib/assets/stylesheets/sprite.styl
ende-0.5.19 lib/assets/stylesheets/sprite.styl
ende-0.5.18 lib/assets/stylesheets/sprite.styl
ende-0.5.17 lib/assets/stylesheets/sprite.styl
ende-0.5.16 lib/assets/stylesheets/sprite.styl
ende-0.5.15 lib/assets/stylesheets/sprite.styl
ende-0.5.14 lib/assets/stylesheets/sprite.styl
ende-0.5.13 lib/assets/stylesheets/sprite.styl
ende-0.5.12 lib/assets/stylesheets/sprite.styl
ende-0.5.10 lib/assets/stylesheets/sprite.styl
ende-0.5.9 lib/assets/stylesheets/sprite.styl
ende-0.5.8 lib/assets/stylesheets/sprite.styl
ende-0.5.7 lib/assets/stylesheets/sprite.styl
ende-0.5.6 lib/assets/stylesheets/sprite.styl
ende-0.4.25 lib/assets/stylesheets/sprite.styl
ende-0.5.5 lib/assets/stylesheets/sprite.styl
ende-0.5.4 lib/assets/stylesheets/sprite.styl
ende-0.5.3 lib/assets/stylesheets/sprite.styl