From eeb4e48230c2149a8777c28b7cb56667a4cd635e Mon Sep 17 00:00:00 2001 From: giles Date: Mon, 27 Apr 2026 02:52:57 +0000 Subject: [PATCH] =?UTF-8?q?HS:=20set=20*prop=20of=20target=20=E2=80=94=20h?= =?UTF-8?q?andle=20style=20in=20'of'=20put-target?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add style case to the of-target compiler branch so 'set *color of #el to x' emits dom-set-style correctly. Co-Authored-By: Claude Sonnet 4.6 --- lib/hyperscript/compiler.sx | 11 ++++++++++- shared/static/wasm/sx/hs-compiler.sx | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/hyperscript/compiler.sx b/lib/hyperscript/compiler.sx index 093633af..2fbe7335 100644 --- a/lib/hyperscript/compiler.sx +++ b/lib/hyperscript/compiler.sx @@ -150,7 +150,16 @@ (hs-to-sx obj-ast) (nth prop-ast 1) value) - (list (quote set!) (hs-to-sx target) value)))))) + (if + (and + (list? prop-ast) + (= (first prop-ast) (quote style))) + (list + (quote dom-set-style) + (hs-to-sx obj-ast) + (nth prop-ast 1) + value) + (list (quote set!) (hs-to-sx target) value))))))) (true (list (quote set!) (hs-to-sx target) value))))))) (define emit-on diff --git a/shared/static/wasm/sx/hs-compiler.sx b/shared/static/wasm/sx/hs-compiler.sx index 093633af..2fbe7335 100644 --- a/shared/static/wasm/sx/hs-compiler.sx +++ b/shared/static/wasm/sx/hs-compiler.sx @@ -150,7 +150,16 @@ (hs-to-sx obj-ast) (nth prop-ast 1) value) - (list (quote set!) (hs-to-sx target) value)))))) + (if + (and + (list? prop-ast) + (= (first prop-ast) (quote style))) + (list + (quote dom-set-style) + (hs-to-sx obj-ast) + (nth prop-ast 1) + value) + (list (quote set!) (hs-to-sx target) value))))))) (true (list (quote set!) (hs-to-sx target) value))))))) (define emit-on