From 236e76e17ca08dda44a35b2a171245efa4fe9a1e Mon Sep 17 00:00:00 2001 From: heulitig Date: Mon, 11 Sep 2023 10:42:29 +0530 Subject: [PATCH] class name fix + other minor fixes --- fastn-js/js/dom.js | 4 +- ftd/t/js/54-class-fix.ftd | 10 ++++ ftd/t/js/54-class-fix.html | 93 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 ftd/t/js/54-class-fix.ftd create mode 100644 ftd/t/js/54-class-fix.html diff --git a/fastn-js/js/dom.js b/fastn-js/js/dom.js index 38242faf23..9f205471bb 100644 --- a/fastn-js/js/dom.js +++ b/fastn-js/js/dom.js @@ -872,7 +872,7 @@ class Node2 { attachCss(property, value, createClass, className) { let propertyShort = fastn_dom.propertyMap[property] || property; propertyShort = `__${propertyShort}`; - let cls = `${propertyShort}-${JSON.stringify(value)}`; + let cls = `${propertyShort}-${JSON.stringify(fastn_dom.class_count)}`; if (!!className) { cls = className; } else { @@ -1236,7 +1236,7 @@ class Node2 { this.attachCss("align-items", "end"); break; case 'bottom-center': - this.attachCss("justify-content", "start"); + this.attachCss("justify-content", "center"); this.attachCss("align-items", "end"); break; case 'bottom-right': diff --git a/ftd/t/js/54-class-fix.ftd b/ftd/t/js/54-class-fix.ftd new file mode 100644 index 0000000000..c86a68bba9 --- /dev/null +++ b/ftd/t/js/54-class-fix.ftd @@ -0,0 +1,10 @@ +-- ftd.text: Hello +background.solid: $bg-yg + +-- ftd.text: hello +background.solid: yellow + + +-- ftd.color bg-yg: +light: yellow +dark: green diff --git a/ftd/t/js/54-class-fix.html b/ftd/t/js/54-class-fix.html new file mode 100644 index 0000000000..36b2d923e1 --- /dev/null +++ b/ftd/t/js/54-class-fix.html @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + +
Hello
hello
+ +