Skip to content

Instantly share code, notes, and snippets.

@logicaroma
Created August 5, 2013 06:54
Show Gist options
  • Save logicaroma/6153960 to your computer and use it in GitHub Desktop.
Save logicaroma/6153960 to your computer and use it in GitHub Desktop.
less function for creating pseudo class stylig for a button object
// Button pseudo states
// -------------------------
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
.btn-pseudo-states(@color; @background; @border) {
color: @color;
background-color: @background;
border-color: @border;
&:hover,
&:focus,
&:active,
&.active {
background-color: darken(@background, 5%);
border-color: darken(@border, 10%);
}
&.disabled,
&[disabled],
fieldset[disabled] & {
&,
&:hover,
&:focus,
&:active,
&.active {
background-color: @background;
border-color: @border
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment