Skip to content

Instantly share code, notes, and snippets.

@vgpena
Created June 11, 2014 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgpena/a9a831190131512f9004 to your computer and use it in GitHub Desktop.
Save vgpena/a9a831190131512f9004 to your computer and use it in GitHub Desktop.
bow to the power of SASS lists
input:
@each $type in solar-to-home, solar-to-grid, solar-to-battery, grid-to-home, grid-to-battery, battery-to-home, battery-to-grid
##{$type} > .flow-img
background-image: image-url('#{$type}-bg.png')
output:
#solar-to-home > .flow-img {
background-image: url('../img/solar-to-home-bg.png?1402522356');
}
#solar-to-grid > .flow-img {
background-image: url('../img/solar-to-grid-bg.png?1402522443');
}
#solar-to-battery > .flow-img {
background-image: url('../img/solar-to-battery-bg.png?1402522428');
}
#grid-to-home > .flow-img {
background-image: url('../img/grid-to-home-bg.png?1402522402');
}
#grid-to-battery > .flow-img {
background-image: url('../img/grid-to-battery-bg.png?1402522386');
}
#battery-to-home > .flow-img {
background-image: url('../img/battery-to-home-bg.png?1402522374');
}
#battery-to-grid > .flow-img {
background-image: url('../img/battery-to-grid-bg.png?1402522340');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment