From 4850faa3764b8b2d29be9e86d106d9c6839ea7a3 Mon Sep 17 00:00:00 2001 From: Arthur Wallendorff Date: Sun, 23 Feb 2025 23:28:45 +0100 Subject: [PATCH 1/6] fix(docs): update possessive expression with working example --- www/expressions/possessive.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/expressions/possessive.md b/www/expressions/possessive.md index 7d3a9ab2..e933c80d 100644 --- a/www/expressions/possessive.md +++ b/www/expressions/possessive.md @@ -25,9 +25,11 @@ The possessive expression can also be used to get and set attributes of an eleme Go to Duck Duck Go
- Replace Me w/ Attribute Data
+ ``` From 36f01738c58678be3a6b486aabfaaac84e8448af Mon Sep 17 00:00:00 2001 From: Arthur Wallendorff Date: Sun, 23 Feb 2025 23:34:03 +0100 Subject: [PATCH 2/6] chore: add more examples to show syntax --- www/expressions/attribute-ref.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/expressions/attribute-ref.md b/www/expressions/attribute-ref.md index 8abdcbce..9319e0fc 100644 --- a/www/expressions/attribute-ref.md +++ b/www/expressions/attribute-ref.md @@ -15,7 +15,11 @@ Attribute references are similar to CSS attribute references, and may or may not ### Examples ```html - + + + + + ``` From ed1f9491c5bc34d060dd85e7b9dae0f530b5c16f Mon Sep 17 00:00:00 2001 From: Arthur Wallendorff Date: Sun, 23 Feb 2025 23:44:00 +0100 Subject: [PATCH 3/6] fix: remove outdated note + fix examples --- www/commands/add.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/www/commands/add.md b/www/commands/add.md index 23c256bd..c83de273 100644 --- a/www/commands/add.md +++ b/www/commands/add.md @@ -15,8 +15,6 @@ add [to ] [wh The `add` command allows you to add a class (via a [class ref](/expressions/class-reference)), an attribute (via an [attribute ref](/expressions/attribute-ref)) or CSS attributes (via an object literal) to either the current element or to another element. -**Note:** Hyperscript supports hyphens in object property names, so you can write `add { font-size: '2em' }`. However, double hyphens (`--`) mark comments in hyperscript, so if you need to use them for [CSS Custom Properties][], use quotes -- `add { '--big-font-size': '2em' }`. - The `where` clause allows you filter what elements have the class or property added in the `target`. The expression will be evaluated for each element in `target` and, if the result is true, the element class or property will be added. If it is false, the class or property will be removed. The `it` symbol will be set to the current element, allowing you to express conditions against each element @@ -27,15 +25,15 @@ in `target`. Note that this clause only works with classes and properties. ```html
Click Me!
-
Click Me!
+
Click Me!
- + - + ``` From 62aedd3e87dfaaebb124cf25fcf47f656ac0880f Mon Sep 17 00:00:00 2001 From: Arthur Wallendorff Date: Sun, 23 Feb 2025 23:46:21 +0100 Subject: [PATCH 4/6] chore: add parameters to example function --- www/features/def.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/features/def.md b/www/features/def.md index cb0d8d4c..50c10b2e 100644 --- a/www/features/def.md +++ b/www/features/def.md @@ -25,9 +25,9 @@ Functions are typically placed in script tags: ```html ``` From cb92c4233658c5d14a0747c933bf8c48c67cf8c2 Mon Sep 17 00:00:00 2001 From: Arthur Wallendorff Date: Mon, 24 Feb 2025 00:02:27 +0100 Subject: [PATCH 5/6] docs: add example for classes prefixed with a dash --- www/commands/add.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/commands/add.md b/www/commands/add.md index c83de273..9dc2dcd7 100644 --- a/www/commands/add.md +++ b/www/commands/add.md @@ -36,4 +36,6 @@ in `target`. Note that this clause only works with classes and properties. + + ``` From 1fc364508eade7aaa2b1830b2f51927a916d461b Mon Sep 17 00:00:00 2001 From: Arthur Wallendorff Date: Mon, 24 Feb 2025 00:03:48 +0100 Subject: [PATCH 6/6] chore: make the sentence a bit clearer --- www/expressions/possessive.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/expressions/possessive.md b/www/expressions/possessive.md index e933c80d..a629c8fa 100644 --- a/www/expressions/possessive.md +++ b/www/expressions/possessive.md @@ -30,6 +30,6 @@ The possessive expression can also be used to get and set attributes of an eleme > ```