From 4155a556f630022392818b70f374809b31d49236 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 21 Jan 2024 20:43:36 +0530 Subject: docs: readme --- docs/api/functions.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'docs/api/functions.md') 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 -- cgit v1.3.1