Skip to content

Instantly share code, notes, and snippets.

@dmitry-ilyashevich
Created May 6, 2015 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dmitry-ilyashevich/0a26630841387c4f5081 to your computer and use it in GitHub Desktop.
Save dmitry-ilyashevich/0a26630841387c4f5081 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// 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');
}
.foo {
content: 70;
}
.bar {
content: G;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment