From: Jason Woofenden Date: Fri, 18 Sep 2015 22:30:18 +0000 (-0400) Subject: stylus: support svg sprites with pixmap fallback X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=84a6325c7819e0a331e1ba87e745a469e249027e stylus: support svg sprites with pixmap fallback --- diff --git a/stylus_helpers.styl b/stylus_helpers.styl index df34bb0..3c358f0 100644 --- a/stylus_helpers.styl +++ b/stylus_helpers.styl @@ -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)