Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.