diff options
Diffstat (limited to 'src/utils/styling.ts')
| -rw-r--r-- | src/utils/styling.ts | 8 |
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]; + } + } +}; |
