mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-18 06:35:27 +01:00
10 lines
385 B
TypeScript
10 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);
|
|
}
|
|
};
|