Created
August 27, 2014 00:36
-
-
Save shadowmint/f902be990b434646fd49 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.0) | |
// ---- | |
@function str-split($value) { | |
$rtn: (); | |
$tmp: $value; | |
$busy: true; | |
@while $busy { | |
$index: str-index($tmp, ' '); | |
@if $index { | |
$bit: str-slice($tmp, 0, $index - 1); | |
$rtn: append($rtn, $bit); | |
$tmp: str-slice($tmp, $index + 1); | |
} | |
@else { | |
$rtn: append($rtn, $tmp); | |
$busy: false; | |
} | |
} | |
@return $rtn; | |
} | |
.foo { | |
@each $key in str-split("This is a long string") { | |
.#{$key} { | |
color: #fff; | |
} | |
} | |
} |
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
.foo .This { | |
color: #fff; | |
} | |
.foo .is { | |
color: #fff; | |
} | |
.foo .a { | |
color: #fff; | |
} | |
.foo .long { | |
color: #fff; | |
} | |
.foo .string { | |
color: #fff; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment