From ca0737e393bbf5c45f688593bbfaf41079a66784 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 25 Aug 2023 12:14:42 +0530 Subject: feat: h expressions for declaring elements --- examples/clock/style.css | 15 +++++++-------- examples/form/signup.css | 5 ----- 2 files changed, 7 insertions(+), 13 deletions(-) (limited to 'examples') diff --git a/examples/clock/style.css b/examples/clock/style.css index c23e033..07b8cc9 100644 --- a/examples/clock/style.css +++ b/examples/clock/style.css @@ -6,7 +6,13 @@ font-family: sans-serif; color: #555; - --cssx-children: div#digital div#analog; + --cssx-children: + div#digital + h(div#analog, map(), seq( + div#seconds.analog-clock-hand, + div#minutes.analog-clock-hand, + div#hours.analog-clock-hand + )); } body * { box-sizing: border-box; } @@ -44,7 +50,6 @@ body * { box-sizing: border-box; } --cssx-on-mount: update(--date, call(--get-date)); --cssx-on-update: - update('[data-element=seconds]', --angle, js-eval("360 * new Date().getSeconds() / 60 - 90")), update('[data-element=seconds]', --angle, js-eval("360 * new Date().getSeconds() / 60 - 90")) update('[data-element=minutes]', --angle, js-eval("360 * new Date().getMinutes() / 60 - 90")) update('[data-element=hours]', --angle, @@ -52,12 +57,6 @@ body * { box-sizing: border-box; } ) delay(1s) update(--date, call(--get-date)); - - --cssx-children: - div#seconds.analog-clock-hand - div#minutes.analog-clock-hand - div#hours.analog-clock-hand - ; } [data-element=seconds].analog-clock-hand { diff --git a/examples/form/signup.css b/examples/form/signup.css index 5dfb8f6..ee0c2c1 100644 --- a/examples/form/signup.css +++ b/examples/form/signup.css @@ -43,11 +43,6 @@ input#input-email input#input-password #actions - h(#message[data-attr="wiow"], map(--wow: "wow"), - div#wow - div#yay - h(div#yay, map(--wow: "wow")) - ) ; } #form.submitted #message::after { -- cgit v1.3.1