aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/how-it-works.md17
1 files changed, 6 insertions, 11 deletions
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("',