-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Milestone
Description
A common snippet I see in the plugin onload
is something like this:
const styleSheet = document.createElement('link');
styleSheet.rel = 'stylesheet';
styleSheet.href = this.app.vault.adapter.getResourcePath(`${this.manifest.dir}/styles.css`);
document.head.appendChild(styleSheet);
Which makes no sense, since Obsidian already handles that, so it's probably generated by an LLM.
Or also, most often found in modals:
const style = document.createElement('style');
style.textContent = `Some CSS here`;
document.head.appendChild(style);
Both of these usually also have no cleanup function.