Last active
September 25, 2015 21:47
-
-
Save bergantine/989602 to your computer and use it in GitHub Desktop.
SCSS Mixix Example. #sass #scss #demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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