aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/styling.ts
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-02-14 12:27:01 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-02-14 12:27:01 +0530
commit7a6707374f231d9cb07476c9453727ee5c6c9a45 (patch)
tree91b42f57ee2a3fbc05cf1f8f46df8b5018bd2764 /src/utils/styling.ts
parent1393f99b39906f85689f7781da188e6fb414eaf6 (diff)
downloadbanglar-bhumi-utils-7a6707374f231d9cb07476c9453727ee5c6c9a45.tar.gz
banglar-bhumi-utils-7a6707374f231d9cb07476c9453727ee5c6c9a45.zip
Using on loaded scripts for chaning styles.
Diffstat (limited to 'src/utils/styling.ts')
-rw-r--r--src/utils/styling.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/styling.ts b/src/utils/styling.ts
new file mode 100644
index 0000000..0e527d9
--- /dev/null
+++ b/src/utils/styling.ts
@@ -0,0 +1,8 @@
+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];
+ }
+ }
+};