Skip to content

Instantly share code, notes, and snippets.

@lipelopeslage
Created June 22, 2016 18:51
Show Gist options
  • Save lipelopeslage/a0518f3d145f04871050baa142dc2fba to your computer and use it in GitHub Desktop.
Save lipelopeslage/a0518f3d145f04871050baa142dc2fba to your computer and use it in GitHub Desktop.
Stylus aux functions
roundborder(x)
-moz-border-radius x
-webkit-border-radius x
border-radius x
unselectable()
-moz-user-select -moz-none
-khtml-user-select none
-webkit-user-select none
selectable()
-moz-user-select -moz-text
-khtml-user-select text
-webkit-user-select text
set_font(ff = opensans_regular, fz = 10, lh = auto, c = black, ta = none, tt = none)
font-family ff
font-size fz
line-height lh
color c
text-align ta
text-transform tt
dimensions(w = 40px, h = 40px, bg = transparent)
width w
height h
background bg
none()
display none
inline()
display inline
block()
display block
absolute()
position absolute
relative()
position relative
fixed()
position fixed
block-relative()
block()
relative()
block-relative-left()
block()
relative()
float left
block-relative-right()
block()
relative()
float right
block-absolute()
block()
absolute()
image(src)
url('../../assets/'+src)
antialiased()
-moz-font-smoothing antialiased
-webkit-font-smoothing antialiased
prefix(what, args...)
-webkit-{what} args
-moz-{what} args
{what} args
transition(args...)
prefix('transition', args)
transform(args...)
prefix('transform', args)
opensans(fz = 10, lh = auto, c = white, ta = none, tt = none)
set_font('Open Sans', fz, lh, c, ta, tt)
support-for-ie ?= true
opacity(n)
opacity n
if support-for-ie
filter unquote('progid:DXImageTransform.Microsoft.Alpha(Opacity=' + round(n * 100) + ')')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment