From 1034dc5d453cefb0e86bca9eae97bce527ad985d Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 21 Jan 2024 21:14:33 +0530 Subject: Update how-it-works.md --- docs/how-it-works.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'docs') diff --git a/docs/how-it-works.md b/docs/how-it-works.md index 585b8cc..d97f9fe 100644 --- a/docs/how-it-works.md +++ b/docs/how-it-works.md @@ -75,17 +75,12 @@ This is by far the most "fun" aspect of this project. Take a look at the docs fo ```css #my-element { - --factorial: - func(--n: number) - if( - js-eval(string(get-var(--n), '> 1')), - js-eval(string( - get-var(--n), - ' * ', - call(--factorial, map(--n: js-eval(string(get-var(--n), ' - 1')))) - )), - 1 - ); + --factorial: func(--n: number) + if(lte(get-var(--n), 1), 1, + calc( + get-var(--n) + * call(--factorial, map(--n: calc(get-var(--n) - 1))) + )); --cssx-on-mount: js-eval(string( 'console.log("', -- cgit v1.3.1