Skip to content

Instantly share code, notes, and snippets.

@ruzzbot
Created October 17, 2012 03:26
Show Gist options
  • Save ruzzbot/3903539 to your computer and use it in GitHub Desktop.
Save ruzzbot/3903539 to your computer and use it in GitHub Desktop.
stylus mixin boilerplate
//==================================================================== VARS
ani_speed = 0.5s
img_path( filename )
'assets/images/'+filename
font_path( filename )
'assets/fonts/'+filename
//=================================================================== FONTS
// embed_font loads your fonts faster - no muss, no fuss
embed_font( family_name, filename )
@font-face
font-family: family_name
font-weight: normal
font-style: normal
src: url( font_path(filename+'.eot') )
src: local('☺'), url( font_path(filename+'.woff')) format('woff'), url(font_path(filename+'.ttf')) format('truetype'), url(font_path(filename+'.svg#'+family_name )) format('svg')
// load fonts into font-namespaces
embed_font( 'MyFont', 'My-webfont' )
// Common font-family stacks
fontfam1 = "MyFont", arial, "Comic Sans MS"
//=================================================================== COLOR
// solid colors
red_blood = #B11616
red_glow = #FF3838
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment