Created
May 6, 2015 10:15
-
-
Save cahnory/e7af79a9820214442692 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
// ---- | |
// Sass (v3.4.13) | |
// Compass (v1.0.3) | |
// ---- | |
@function chain($value, $functions...) { | |
@each $function in $functions { | |
$value: call(nth($function, 1), set-nth($function, 1, $value)...); | |
} | |
@return $value; | |
} | |
@function double($value) { | |
@return $value * 2; | |
} | |
@function multiply($a, $b) { | |
@return $a * $b; | |
} | |
.foo { | |
content: chain(7, 'double', ('multiply', 5)); | |
} | |
.bar { | |
content: chain('g', 'to-upper-case', 'unquote'); | |
} |
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
.foo { | |
content: 70; | |
} | |
.bar { | |
content: G; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment