Skip to content

Instantly share code, notes, and snippets.

@csswizardry
Created November 10, 2015 20:23
Show Gist options
  • Save csswizardry/18e6093bda0fd6ffc371 to your computer and use it in GitHub Desktop.
Save csswizardry/18e6093bda0fd6ffc371 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<button class="btn">Click</button>
<a href="#0" class="btn">Click</a>
<input type="submit" class="btn" value="Click" />
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
$btn-color: black;
$btn-bg: yellow;
$btn-custom:(
border-radius: 3px,
font: bold 12px/1.5 sans-serif,
);
// _components.btn.scss
$btn-color: red !default;
$btn-bg: green !default;
$btn-padding: 1em 2em !default;
$btn-custom:() !default;
.btn {
display: inline-block;
text-decoration: none;
border: none;
background: none;
font: inherit;
cursor: pointer;
padding: $btn-padding;
color: $btn-color;
background-color: $btn-bg;
@each $property, $value in $btn-custom {
#{$property}: $value;
}
}
.btn {
display: inline-block;
text-decoration: none;
border: none;
background: none;
font: inherit;
cursor: pointer;
padding: 1em 2em;
color: black;
background-color: yellow;
border-radius: 3px;
font: bold 12px/1.5 sans-serif;
}
<button class="btn">Click</button>
<a href="#0" class="btn">Click</a>
<input type="submit" class="btn" value="Click" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment