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.2 lib/assets/stylesheets/sprite.styl
ende-0.4.24 lib/assets/stylesheets/sprite.styl
ende-0.4.23 lib/assets/stylesheets/sprite.styl
ende-0.5.1 lib/assets/stylesheets/sprite.styl
ende-0.4.22 lib/assets/stylesheets/sprite.styl
ende-0.4.21 lib/assets/stylesheets/sprite.styl
ende-0.5.0 lib/assets/stylesheets/sprite.styl
ende-0.4.20 lib/assets/stylesheets/sprite.styl
ende-0.4.19 lib/assets/stylesheets/sprite.styl
ende-0.4.18 lib/assets/stylesheets/sprite.styl
ende-0.4.17 lib/assets/stylesheets/sprite.styl
ende-0.4.16 lib/assets/stylesheets/sprite.styl
ende-0.3.13 lib/assets/stylesheets/sprite.styl
ende-0.3.12 lib/assets/stylesheets/sprite.styl
ende-0.3.11 lib/assets/stylesheets/sprite.styl
ende-0.4.15 lib/assets/stylesheets/sprite.styl
ende-0.4.14 lib/assets/stylesheets/sprite.styl
ende-0.4.13 lib/assets/stylesheets/sprite.styl
ende-0.4.12 lib/assets/stylesheets/sprite.styl
ende-0.4.11 lib/assets/stylesheets/sprite.styl