Skip to content

Instantly share code, notes, and snippets.

@kogakure
Created February 20, 2015 11:53
Show Gist options
  • Save kogakure/8376b401d16c796b1762 to your computer and use it in GitHub Desktop.
Save kogakure/8376b401d16c796b1762 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
@mixin attention($self: false) {
@if($self != false) {
&,
&:hover,
&:active,
&:focus {
@content;
}
}
@else {
&:hover,
&:active,
&:focus {
@content;
}
}
}
// Generate Helvetica Neue’s numbered font-weights from their aliases.
@mixin font-weight($font-weight) {
@if ($font-weight == "regular") {
font-weight: 300;
}
@if ($font-weight == "bold") {
font-weight: 600;
}
}
@mixin headings($from: 1, $to: 6) {
%base-heading {
@content;
}
@if $from >= 1 and $to <= 6{
@for $i from $from through $to{
h#{$i} {
@extend %base-heading;
}
}
}
}
// ---------------------------------------------------------------
@include headings() {
@include font-weight(regular);
color: red;
}
.btn {
@include font-weight(bold);
@include attention() {
background-color: blue;
}
}
.btn--positive {
@include font-weight(regular);
@include attention(self) {
background-color: red;
}
}
h1, h2, h3, h4, h5, h6 {
font-weight: 300;
color: red;
}
.btn {
font-weight: 600;
}
.btn:hover, .btn:active, .btn:focus {
background-color: blue;
}
.btn--positive {
font-weight: 300;
}
.btn--positive, .btn--positive:hover, .btn--positive:active, .btn--positive:focus {
background-color: red;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment