Last active
February 27, 2016 08:31
-
-
Save sixertoy/f9b896c1159da3040f34 to your computer and use it in GitHub Desktop.
Less-curious Loop For Each Example
This file contains hidden or 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
.socials { | |
@names: facebook, instagram, rss, twitter; | |
.icon{ | |
width: 24px; | |
height: 24px; | |
display:block; | |
overflow: hidden; | |
text-indent: -9999px; | |
background: url(../images/socials_icons_24x24.png) no-repeat 0 0 transparent; | |
.for(1, length(@names)); .-each(@i) { | |
@name: extract(@names, @i); | |
&-@{name} { | |
background-position: ((@i - 1) * -24px) 0; | |
} | |
} | |
} | |
} |
This file contains hidden or 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
@count:100; | |
.loop (@index, @step) when (@index > -1) { | |
.span@{index} { | |
opacity: (@index / 100); | |
} | |
@tmp:(@index - @step); | |
.loop(@tmp, @step); | |
} | |
.loop (@count, 25); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment