Sha256: 8e98c154b36441aeb2e07763d2bd35e6acb1a856d9349d34328b88bf10bdc2da

Contents?: true

Size: 1.73 KB

Versions: 1

Compression:

Stored size: 1.73 KB

Contents

@mixin build-sprite-css( $images, $size, $width )
  background-image: $images
  background-repeat: no-repeat
  @if $size == retina
    @include background-size($width/2 auto)

@mixin build-sprites($name, $images, $size: normal)
  $sprite-names: sprite-names($images)

  $width: 0px
  @each $sprite-name in $sprite-names 
    @if $sprite-name != nil and $images != nil
      $tmp-width: image-width(sprite-file($images, $sprite-name))
      @if $tmp-width > $width
        $width: $tmp-width
  $background-width: $width

  .#{$name}-sprite-map
    @include build-sprite-css( $images, $size, $background-width )

  @each $sprite-name in $sprite-names
    $full-sprite-name: "#{$name}-#{$sprite-name}"
    .#{$full-sprite-name}-no-dimensions
      @include build-sprite-css( $images, $size, $background-width )
      @include sprite($images, $sprite-name)

    $spt_pos: sprite-position($images, $sprite-name)
    $xpos: 0
    $ypos: 0
    $width: 0
    $height: 0
    @if $size == retina
      $xpos: round(nth($spt_pos, 1) / 2)
      $ypos: round(nth($spt_pos, 2) / 2)
      $height: image-height(sprite-file($images, $sprite-name))/2
      $width: image-width(sprite-file($images, $sprite-name))/2
    @else
      $xpos: round(nth($spt_pos, 1))
      $ypos: round(nth($spt_pos, 2))
      $height: image-height(sprite-file($images, $sprite-name))
      $width: image-width(sprite-file($images, $sprite-name))

    .#{$full-sprite-name}-half-x
      left: -($width/2)
    .#{$full-sprite-name}-half-y
      top: -($height/2)

    .#{$full-sprite-name}
      @include build-sprite-css( $images, $size, $background-width )
      //@include sprite-background-position($images, $sprite-name)
      background-position: $xpos $ypos
      width: $width
      height: $height

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iugu-ux-0.6.7 vendor/assets/stylesheets/iugu-ux/sprite-mixins.sass