mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-06 04:40:15 +01:00
11 lines
385 B
TypeScript
11 lines
385 B
TypeScript
|
|
export const addStyle = (url: string, id: string) => {
|
||
|
|
if (!document.getElementById(id)) {
|
||
|
|
const styleElement = document.createElement("link");
|
||
|
|
styleElement.id = id;
|
||
|
|
styleElement.rel = "stylesheet";
|
||
|
|
styleElement.type = "text/css";
|
||
|
|
styleElement.href = url;
|
||
|
|
document.getElementsByTagName("head")[0].appendChild(styleElement);
|
||
|
|
}
|
||
|
|
};
|