aboutsummaryrefslogtreecommitdiff
path: root/docs/api/functions.md
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-01-21 20:43:36 +0530
committerAkshay Nair <phenax5@gmail.com>2024-01-21 20:46:38 +0530
commit4155a556f630022392818b70f374809b31d49236 (patch)
treedb48a9e3deba5b3f3064711eafa68bd4ba210ef3 /docs/api/functions.md
parente4db8ebdd6a36df0b3d76504d18d8f183fe46ba9 (diff)
downloadcss-everything-4155a556f630022392818b70f374809b31d49236.tar.gz
css-everything-4155a556f630022392818b70f374809b31d49236.zip
docs: readme
Diffstat (limited to 'docs/api/functions.md')
-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