Add new utility functions and update styles

This commit is contained in:
Harvey Zack committed 2023-11-23 23:58:24 +08:00
1 parent 29ff487547
commit 780124d84b
5 files changed
+47 -25

No files matched your search

+12
View File
@@ -95,3 +95,15 @@ export function getIcon(key = '', html = '') {
append(icon, html);
return icon;
}
export function setStyleText(id, style) {
const $style = document.getElementById(id);
if ($style) {
$style.textContent = style;
} else {
const $style = createElement('style');
$style.id = id;
$style.textContent = style;
document.head.appendChild($style);
}
}