X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=stylus_helpers.styl;h=9aa4b6bb3cb5b110e67aa7775800efa4f798f7ac;hb=aaa842251277ac7053c78f2b17d1e4815020c041;hp=df34bb0819f52ef9cd4bf90aaf577982edf58e51;hpb=c852a59520b9b39903d16313e1821754539eabca;p=wfpl.git diff --git a/stylus_helpers.styl b/stylus_helpers.styl index df34bb0..9aa4b6b 100644 --- a/stylus_helpers.styl +++ b/stylus_helpers.styl @@ -1,4 +1,7 @@ -// Copyright 2014 Jason Woofenden -- Public Domain (CC0) +// This program is in the public domain within the United States. Additionally, +// we waive copyright and related rights in the work worldwide through the CC0 +// 1.0 Universal public domain dedication, which can be found at +// http://creativecommons.org/publicdomain/zero/1.0/ // This file contains helpers for using stylus in your project. // @@ -95,7 +98,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 +117,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)