JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
stylus: support svg sprites with pixmap fallback
authorJason Woofenden <jason@jasonwoof.com>
Fri, 18 Sep 2015 22:30:18 +0000 (18:30 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 18 Sep 2015 22:30:18 +0000 (18:30 -0400)
stylus_helpers.styl

index df34bb0..3c358f0 100644 (file)
@@ -95,7 +95,11 @@ space_evenly(line_height = 1.2em)
 sprites_rollover(image, width, height, count, v_offset = 0, h_offset = 0)
        width: unit(width, px)
        height: unit(height, px)
-       background-image: url(image)
+       if image[1]
+               background: url(image[0])
+               background: url(image[1]), linear-gradient(transparent, transparent);
+       else
+               background-image: url(image)
        background-position: top left
        background-repeat: no-repeat;
        for n in (0...count)
@@ -110,7 +114,11 @@ sprite_rollover(image, width, height, v_offset = 0, h_offset = 0)
 // see sprites_rollover
 sprites(image, height, count, v_offset = 0, h_offset = 0)
        height: unit(height, px)
-       background-image: url(image)
+       if image[1]
+               background: url(image[0])
+               background: url(image[1]), linear-gradient(transparent, transparent);
+       else
+               background-image: url(image)
        background-position: top left
        background-repeat: no-repeat;
        for n in (0...count)