From: Jason Woofenden Date: Thu, 4 Dec 2014 14:31:30 +0000 (-0500) Subject: stylus: sprites 0-based, add placeholder,noselect X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=c25c54f65fe42aeb61caab597e2747fdc0ef1225 stylus: sprites 0-based, add placeholder,noselect --- diff --git a/stylus-helpers.styl b/stylus-helpers.styl index ab65706..3d7373a 100644 --- a/stylus-helpers.styl +++ b/stylus-helpers.styl @@ -85,8 +85,8 @@ space-evenly(line_height = 1.2em) // html: // // styl: @@ -96,9 +96,9 @@ sprites-rollover(image, width, height, count, h-offset = 0) width: unit(width, px) height: unit(height, px) background: transparent url(image) top left no-repeat; - for n in (1..count) + for n in (0...count) &.n{n} - y = - (@height * ( n - 1)) - h-offset + y = - (@height * n) - h-offset background-position 0 y &:hover background-position -(@width) y @@ -106,9 +106,9 @@ sprites-rollover(image, width, height, count, h-offset = 0) sprites(image, height, count, h-offset = 0) height: unit(height, px) background: transparent url(image) top left no-repeat; - for n in (1..count) + for n in (0...count) &.n{n} - y = - (@height * ( n - 1)) - h-offset + y = - (@height * n) - h-offset background-position 0 y // Styling for a variable height element with an image background where the @@ -174,3 +174,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