X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=stylus_helpers.styl;fp=stylus_helpers.styl;h=85f8d12690534cd23efb8c965d2f37cb9e8765ba;hb=de9d8d4999bf24e255e583bf69bc4d1a530af2df;hp=d885abed777a6e146eda1914a754a26faa44f61e;hpb=eafd74d9b5fbfada1026ab604202d8a690286cb4;p=wfpl.git diff --git a/stylus_helpers.styl b/stylus_helpers.styl index d885abe..85f8d12 100644 --- a/stylus_helpers.styl +++ b/stylus_helpers.styl @@ -150,7 +150,14 @@ sprites(image, height, count, v_offset = 0, h_offset = 0) y = - (@height * n) - unit(v_offset, px) background-position: (0 - unit(h_offset, px)) y sprite(image, height, v_offset = 0, h_offset = 0) - sprites(image, height, 1, v_offset, h_offset) + height: unit(height, px) + if image[1] + background: url(image[0]) + background: url(image[1]), linear-gradient(transparent, transparent); + else + background-image: url(image) + background-repeat: no-repeat; + background-position: (0 - unit(h_offset, px)) (0 - unit(v_offset, px)) // Styling for a variable height element with an image background where the // middle repeats vertically. You must split your image into three images, and