aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/styling.ts
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-03-27 21:38:43 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-03-27 21:38:43 +0530
commitd178caee5c93ad9ed91dbd082b0f0b5a9b0507aa (patch)
treeccfdf4c6992a86955c80780de0518a2fea10ac39 /src/shared/styling.ts
parent5955bd821303cffa35263c41286339fb28e7536b (diff)
downloadbanglar-bhumi-utils-d178caee5c93ad9ed91dbd082b0f0b5a9b0507aa.tar.gz
banglar-bhumi-utils-d178caee5c93ad9ed91dbd082b0f0b5a9b0507aa.zip
Refactoring code.
Only using hashes for output file names. Using singleton pattern to store the callbacks for observeDOM, and only one MutationObserver.
Diffstat (limited to 'src/shared/styling.ts')
-rw-r--r--src/shared/styling.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/shared/styling.ts b/src/shared/styling.ts
index 0e527d9..3ec25c8 100644
--- a/src/shared/styling.ts
+++ b/src/shared/styling.ts
@@ -1,5 +1,6 @@
export const styles = (selector: string, styles: { [key: string]: string }) => {
const elements = Array.from(document.querySelectorAll(selector)) as HTMLElement[];
+
for (const element of elements) {
for (const styleType in styles) {
element.style[styleType as any] = styles[styleType];