We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19fe3e1 commit edd30a0Copy full SHA for edd30a0
2 files changed
.changeset/slimy-vans-fail.md
@@ -0,0 +1,5 @@
1
+---
2
+"@svelte-put/toc": patch
3
4
+
5
+add style tag only if not already added
packages/actions/toc/src/lib/action/toc.operations.ts
@@ -59,10 +59,12 @@ export function resolveParameters(parameters: Partial<TocParameters> = {}): Reso
59
* @param styleString - inline style string
60
*/
61
function addStyle(id: string, styleString: string) {
62
- const style = document.createElement('style');
63
- style.id = id;
64
- style.textContent = styleString;
65
- document.head.append(style);
+ if (!document.getElementById(id)) {
+ const style = document.createElement('style');
+ style.id = id;
+ style.textContent = styleString;
66
+ document.head.append(style);
67
+ }
68
}
69
70
/**
0 commit comments