I have created several mixins for a button to attempt to reduce duplication and contribute to the overall improvement of performance. I am looking for guidance on how to tighten this up so it is as DRY (Don't Repeat Yourself) as possible. Or is it already as DRY as possible?
Here is the code:
// mixin - button shape
@mixin buttonShape {
vertical-align:middle;
line-height:1.333rem;height:2.166rem;
color:#282a2e;
border-radius:0;
margin-top:1.083rem;
margin-bottom:.333rem;
margin-right:1.073rem;
border:none;
transition: background-color .2s;
}
// mixin - button gradients
@mixin gradientNormal {
background-color:#efefee;
background:linear-gradient(to bottom,#efefee 0,#d0d0ce 100%);
box-shadow:inset 0 0 0 .083rem #fff;outline:1px solid silver;
}
@mixin gradientHoverActive {
background:linear-gradient(to bottom,#ffffff 0,#ffffff 100%);
box-shadow:inset 0 0 0 .083rem #fff;outline:2px solid #e87722;
}
// normal state
.ui-button {
font-size: 12px;
@include buttonShape;
@include gradientNormal;
}
// hover
.ui-button:enabled:hover,
.ui-button:focus {
@include buttonShape;
@include gradientHoverActive;
}
// active
.ui-button:enabled:active {
@include buttonShape;
@include gradientHoverActive;
}
<button>
elements? \$\endgroup\$