From 80b84aafb95eae7938cefc4efae11647152a007f Mon Sep 17 00:00:00 2001 From: Koen Lagveen Date: Sun, 11 Feb 2024 16:03:22 +0100 Subject: [PATCH] start adding tests for functions --- Tests/syntax_test_scss.scss | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Tests/syntax_test_scss.scss b/Tests/syntax_test_scss.scss index dd0660a3..15aaf25c 100644 --- a/Tests/syntax_test_scss.scss +++ b/Tests/syntax_test_scss.scss @@ -764,3 +764,20 @@ nav ul { } } +//============================================================================= +// Function +// https://sass-lang.com/documentation/at-rules/function/ +//============================================================================= +@function fibonacci($n) { + $sequence: 0 1; + @for $_ from 1 through $n { + $new: nth($sequence, length($sequence)) + nth($sequence, length($sequence) - 1); + $sequence: append($sequence, $new); + } + @return nth($sequence, length($sequence)); +} + +.sidebar { + float: left; + margin-left: fibonacci(4) * 1px; +}