diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-03-26 22:39:07 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-03-26 22:39:07 +0530 |
| commit | 068a14ffa464d6cb0ccc5c3cec11d10d8cceae90 (patch) | |
| tree | b0d721ca44a705d6d554e3a93479eee51645d3e7 /src/shared/styling.ts | |
| parent | d6682a1ed9acd31dbfdb9e645cc8230c61a268c3 (diff) | |
| download | banglar-bhumi-utils-068a14ffa464d6cb0ccc5c3cec11d10d8cceae90.tar.gz banglar-bhumi-utils-068a14ffa464d6cb0ccc5c3cec11d10d8cceae90.zip | |
Sharing code between scripts for reduced bundle size.
Diffstat (limited to 'src/shared/styling.ts')
| -rw-r--r-- | src/shared/styling.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/styling.ts b/src/shared/styling.ts new file mode 100644 index 0000000..0e527d9 --- /dev/null +++ b/src/shared/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]; + } + } +}; |
