X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=blobdiff_plain;f=stylus-helpers.styl;h=701adfbc9ab44fa7d24760f8fdf71903266179c7;hp=ab65706b662772e0af15233da0e1287e3be1fc0b;hb=eecd5e3576866afc8091abe9b74352130fd8e6cc;hpb=4d60646f1351c4ec8707d783ca6922dbe455edcc diff --git a/stylus-helpers.styl b/stylus-helpers.styl index ab65706..701adfb 100644 --- a/stylus-helpers.styl +++ b/stylus-helpers.styl @@ -85,31 +85,35 @@ space-evenly(line_height = 1.2em) // html: // // styl: // nav li // sprite-rollover "images/nav.png" 150 35 2 -sprites-rollover(image, width, height, count, h-offset = 0) +sprites-rollover(image, width, height, count, v-offset = 0, h-offset = 0) width: unit(width, px) height: unit(height, px) - background: transparent url(image) top left no-repeat; - for n in (1..count) + background-image: url(image) + background-position: top left + background-repeat: no-repeat; + for n in (0...count) &.n{n} - y = - (@height * ( n - 1)) - h-offset - background-position 0 y + y = - (@height * n) - unit(v-offset, px) + background-position (0 - unit(h-offset, px)) y &:hover - background-position -(@width) y + background-position (0 - unit(h-offset, px) - @width) y // see sprites-rollover -sprites(image, height, count, h-offset = 0) +sprites(image, height, count, v-offset = 0, h-offset = 0) height: unit(height, px) - background: transparent url(image) top left no-repeat; - for n in (1..count) + background-image: url(image) + background-position: top left + background-repeat: no-repeat; + for n in (0...count) &.n{n} - y = - (@height * ( n - 1)) - h-offset - background-position 0 y + y = - (@height * n) - unit(v-offset, px) + background-position (0 - unit(h-offset, px)) y // Styling for a variable height element with an image background where the // middle repeats vertically. You must split your image into three images, and @@ -174,3 +178,28 @@ li-reset() margin 0 padding 0 list-style none + +// Example: +// input +// +placeholder() +// color: red +placeholder() + &::-webkit-input-placeholder + {block} + &:-moz-placeholder // firefox 4-18 + {block} + &::-moz-placeholder // firefox 19+ + {block} + &:-ms-input-placeholder // ie + {block} + +// Example: +// div.button +// noselect() +noselect() + -webkit-touch-callout: none + -webkit-user-select: none + -khtml-user-select: none + -moz-user-select: none + -ms-user-select: none + user-select: none