Last active
December 11, 2015 10:25
-
-
Save Juni4567/bb91e7211b9ad129e673 to your computer and use it in GitHub Desktop.
This is a small file that uses less css for loop to create multiple icons style
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
@icons: 'cardboard','chevron-left','chevron-right','expand','image','mail','pencil','qoute-left','mouse-pointer'; | |
.icon { | |
width:20px; | |
height:20px; | |
display: inline-block; | |
background-repeat: no-repeat; | |
background-size: contain; | |
vertical-align: middle; | |
.for(@icons); .-each(@icon) { | |
@name: e(@icon); | |
&-@{name} { | |
background-image: url("images/icons/icon-@{name}.svg"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have multiple icons and you want to make your code DRY then this is the best option I got to save time. Use it anywhere you want! :)