Skip to content

Instantly share code, notes, and snippets.

@patrixd
Created November 23, 2014 15:44
Show Gist options
  • Save patrixd/e242733d23f12d704fa6 to your computer and use it in GitHub Desktop.
Save patrixd/e242733d23f12d704fa6 to your computer and use it in GitHub Desktop.
My Mixins for Stylus. Link style, background linear gradient, vendor, center styles, disable selection and more
@import 'nib'
background-before-layer(opacity, startPoint, startColor, startInterval, endColor, endInterval)
content " "
background-linear-gradient(startPoint, startColor, startInterval, endColor, endInterval)
position absolute
width 100%
height 100%
if opacity
opacity opacity
link(normal_color, hover_color = normal_color)
a, a:link, a:hover
color normal_color
&:hover
color hover_color
vendor(prop, args)
-webkit-{prop} args
-moz-{prop} args
-ms-{prop} args
-o-{prop} args
{prop} args
border-radius()
vendor('border-radius', arguments)
background-linear-gradient(startPoint, startColor, startInterval, endColor, endInterval, deprecatedWebkitStartPoint = false, deprecatedWebkitEndPoint = false)
background-color startColor
if deprecatedWebkitStartPoint && deprecatedWebkitEndPoint
background-image -webkit-gradient(linear, deprecatedWebkitStartPoint, deprecatedWebkitEndPoint, color-stop(startInterval, startColor), color-stop(endInterval, endColor))
background-image -webkit-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
background-image -moz-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
background-image -ms-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
background-image -o-linear-gradient(startPoint, startColor startInterval, endColor endInterval)
background-image linear-gradient(startPoint, startColor startInterval, endColor endInterval)
borderShadow(size)
webkit-box-shadow 0 0 10px 0 rgba(0,0,0,.5)
box-shadow 0 0 10px 0 rgba(0,0,0,.5)
border size solid white
disableSelection()
-webkit-touch-callout none
-webkit-user-select none
-khtml-user-select none
-moz-user-select none
-ms-user-select none
user-select none
centerElement()
position absolute
left 50%
top 50%
-webkit-transform translateY(-50%) translateX(-50%)
verticallyCentered()
display flex
align-items center
justify-content center
whiteFrame()
box-shadow 0 0 10px 0 rgba(0,0,0,0.5)
border 2px solid #fff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment