Skip to content

Instantly share code, notes, and snippets.

@SimplGy
Created May 16, 2013 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimplGy/5595870 to your computer and use it in GitHub Desktop.
Save SimplGy/5595870 to your computer and use it in GitHub Desktop.
Factory for creating bootstrap button overrides using sass. Used for, say, changing the color of the '.btn-primary' bootstrap button.
// This is a bootstrap button factory. Give it a class name and a color and it will build you a shiney bootstrap button override. Wowz.
// usage: +magicalButton('btn-green', green)
@mixin magicalButton($btnClassName: 'defaultPink', $color: #f66, $shading: 15, $highlighting: 10)
#{$btnClassName}
@include linear-gradient( $color, $color - $shading )
#{$btnClassName}:hover, #{$btnClassName}:focus
@include linear-gradient( $color + $highlighting, $color - $shading )
#{$btnClassName}:active, #{$color}.active
@include linear-gradient( $color + $highlighting*2, $color - $shading )
#{$btnClassName}.disabled, #{$btnClassName}[disabled]
@include linear-gradient( $color - 100, $color - 115 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment