Skip to content

Instantly share code, notes, and snippets.

@bergantine
Last active September 25, 2015 21:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bergantine/989602 to your computer and use it in GitHub Desktop.
Save bergantine/989602 to your computer and use it in GitHub Desktop.
SCSS Mixix Example. #sass #scss #demo
// example of string interpolation in a mixin
// matches a particular color and image together following a naming scheme for the images
$green: #7bd939;
$orange: #de712c;
@mixin sectionhead($color, $name) {
.section-head {
background-color: $color;
background-image: url('../../images/masthead-' + $name + '.jpg');
span {
background-image: url('../../images/masthead-' + $name + '.jpg');
}
}
}
#foo {
@include sectionhead($orange, 'orange');
}
#bar {
@include sectionhead($green, 'green');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment