function sassy_compass___compass_nth in Sassy 7.2
Same name and namespace in other branches
- 7.3 sassy_compass/functions/lists.inc \sassy_compass___compass_nth()
1 string reference to 'sassy_compass___compass_nth'
- sassy_compass__first_value_of in extensions/
compass/ functions/ lists.inc
File
- extensions/
compass/ functions/ lists.inc, line 42
Code
function sassy_compass___compass_nth() {
$args = func_get_args();
$place = array_pop($args);
$list = array();
foreach ($args as $arg) {
$list = array_merge($list, sassy_compass__list($arg));
}
if ($place == 'first') {
$place = 0;
}
if ($place == 'last') {
$place = count($list) - 1;
}
if (isset($list[$place])) {
return current(SassScriptLexer::$instance
->lex($list[$place], new SassContext()));
}
return new SassBoolean(false);
}