summaryrefslogtreecommitdiff
path: root/docs/api
diff options
context:
space:
mode:
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/functions.md18
1 files changed, 17 insertions, 1 deletions
diff --git a/docs/api/functions.md b/docs/api/functions.md
index e7bce4f..c5c4cde 100644
--- a/docs/api/functions.md
+++ b/docs/api/functions.md
@@ -13,7 +13,7 @@ type pair = string: any
## Core
-### get-var
+### get-var / var
Get css custom property from an element. Basically var but evaluated lazily.
NOTE: Avoid using `var` inside cssx expressions.
@@ -30,6 +30,22 @@ Example -
}
```
+### calc
+Do some math using the calc syntax. Not 100% compatible but it'll do.
+
+Supported units: rem, em, px, %, ms, s
+
+```typescript
+function calc(calc-expr): string
+```
+
+Example -
+```css
+#my-element {
+ --cssx-text: calc(1 + 5 * get-var(--some-variable));
+}
+```
+
#### update
Update a css custom property on an element