Skip to content

Instantly share code, notes, and snippets.

@jdlehman
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save jdlehman/b36147e990969e8ce40d to your computer and use it in GitHub Desktop.

Select an option

Save jdlehman/b36147e990969e8ce40d to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<button class="Btn">Just a Button</button>
<button class="Btn--disabled">Disabled Button</button>
<button class="Btn-secondary">Secondary Button</button>
<button class="Btn-secondary--disabled">Secondary Disabled Button</button>
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
%Btn-base {
border-radius: 5px;
padding: 0.5rem;
}
@mixin ColoredBtn($color, $background-color) {
@extend %Btn-base;
color: $color;
background-color: $background-color;
}
.Btn {
@include ColoredBtn(white, blue);
// .Btn--disabled
&--disabled {
@include ColoredBtn(white, grey);
}
// .Btn-secondary
&-secondary {
@include ColoredBtn(blue, white);
}
// .Btn-secondary--disabled
&-secondary--disabled {
@include ColoredBtn(blue, light-grey);
}
}
.Btn, .Btn--disabled, .Btn-secondary, .Btn-secondary--disabled {
border-radius: 5px;
padding: 0.5rem;
}
.Btn {
color: white;
background-color: blue;
}
.Btn--disabled {
color: white;
background-color: grey;
}
.Btn-secondary {
color: blue;
background-color: white;
}
.Btn-secondary--disabled {
color: blue;
background-color: light-grey;
}
<button class="Btn">Just a Button</button>
<button class="Btn--disabled">Disabled Button</button>
<button class="Btn-secondary">Secondary Button</button>
<button class="Btn-secondary--disabled">Secondary Disabled Button</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment