Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.