]> Untitled Git - lemmy-ui.git/blob - src/shared/utils/browser/load-css.ts
fix: Add data-bs-theme attribute for user dark/light modes (#1782)
[lemmy-ui.git] / src / shared / utils / browser / load-css.ts
1 export default function loadCss(id: string, loc: string) {
2   if (!document.getElementById(id)) {
3     var head = document.getElementsByTagName("head")[0];
4     var link = document.createElement("link");
5     link.id = id;
6     link.rel = "stylesheet";
7     link.type = "text/css";
8     link.href = loc;
9     link.media = "all";
10     head.appendChild(link);
11   }
12 }