Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpita-Jaiswal authored and Heulitig committed Oct 25, 2023
1 parent e6ff850 commit dc4cad8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions fastn-js/js/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,13 @@ class Node2 {
if (!fastn_dom.classes[cssClass]) {
fastn_dom.classes[cssClass] = fastn_dom.classes[cssClass] || obj;
let styles = document.getElementById('styles');
styles.innerHTML = `${styles.innerHTML}${getClassAsString(cssClass, obj)}\n`;
let newClasses = getClassAsString(cssClass, obj);
let textNode = document.createTextNode(newClasses);
if (styles.styleSheet) {
styles.styleSheet.cssText = newClasses;
} else {
styles.appendChild(textNode);
}
}
return cls;
}
Expand All @@ -953,7 +959,13 @@ class Node2 {
if (!fastn_dom.classes[cssClass]) {
fastn_dom.classes[cssClass] = fastn_dom.classes[cssClass] || obj;
let styles = document.getElementById('styles');
styles.innerHTML = `${styles.innerHTML}${getClassAsString(cssClass, obj)}\n`;
let newClasses = getClassAsString(cssClass, obj);
let textNode = document.createTextNode(newClasses);
if (styles.styleSheet) {
styles.styleSheet.cssText = newClasses;
} else {
styles.appendChild(textNode);
}
}
this.#node.style.removeProperty(property);
this.#node.classList.add(cls);
Expand Down

0 comments on commit dc4cad8

Please sign in to comment.