From 84a6325c7819e0a331e1ba87e745a469e249027e Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Fri, 18 Sep 2015 18:30:18 -0400 Subject: [PATCH] stylus: support svg sprites with pixmap fallback --- stylus_helpers.styl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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) -- 1.7.10.4