diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-08-25 08:13:21 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-08-25 08:13:21 +0530 |
| commit | 6e0f7c0a66117ea458c61bf18c4a721d90523448 (patch) | |
| tree | 4577c3d9bf0d70bb0c1b25bd29497cead77daa3e /docs/api/functions.md | |
| parent | af65d13038dcdeaf93c5c718cbc74c20120c6a22 (diff) | |
| download | css-everything-6e0f7c0a66117ea458c61bf18c4a721d90523448.tar.gz css-everything-6e0f7c0a66117ea458c61bf18c4a721d90523448.zip | |
docs: readme
Diffstat (limited to '')
| -rw-r--r-- | docs/api/functions.md | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/docs/api/functions.md b/docs/api/functions.md new file mode 100644 index 0000000..39f85cb --- /dev/null +++ b/docs/api/functions.md @@ -0,0 +1,91 @@ +# Functions + +```typescript +type custom-property-name = `--${string}` +type selector = string // Any css selector or identifier (used as id) +type condition = string // empty string, 0, 'false', "'false'" and "\"false\"" are all false, the rest are fine. Don't ask. +type duration = number | `${number}ms` | `${number}s` +``` + +## get-var +Get css custom property from an element + +NOTE: Avoid using `var` inside cssx expressions. + +```typescript +function get-var(custom-property-name): string +function get-var(selector, custom-property-name): string +``` + +## update +Update a css custom property on an element + +```typescript +function update(custom-property-name, string): void +function update(selector, custom-property-name, string): string +``` + + +## js-eval +Evaluate any js expression. Easy escape hatch into writing the worst code humanly possible. + +```typescript +function js-eval(string): string +``` + + +## if +If expression. You know how this one goes. If truthy, it'll pick the second argument, else the third. + +```typescript +function if(condition, any, any): any +``` + + +## delay +Wait a bit. + +```typescript +function delay(duration): void +``` + +Examples for input - +- `delay(100)`: wait for 100 milliseconds +- `delay(100ms)`: wait for 100 milliseconds +- `delay(5s)`: wait for 5 seconds +- `delay(0.5s)`: wait for 500 milliseconds + + +## load-cssx + + +## set-attr + + +## attr + + +## prevent-default + + +## request + + +## add-children + + +## remove-element + + +## call-method + + +## map + + +## call + + +## func + + |
