aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hergès <william@herges.fr>2025-08-29 17:19:14 +0200
committerWilliam Hergès <william@herges.fr>2025-08-29 17:19:14 +0200
commitf6ff8f4d1ae95bb229b3142a689cb6a68d12198f (patch)
tree09c275f4b74950e9d564323a94102f87875c3007
parenta5bcd96fe9604ed48d8ca115e4b300690dee4b36 (diff)
fix(style): not everything loaded after custom page switch
-rw-r--r--index.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/index.ts b/index.ts
index e1feaec..e48401f 100644
--- a/index.ts
+++ b/index.ts
@@ -25,6 +25,10 @@ function changePage(href: string) {
window.history.pushState({}, "", href)
document.title = doc.title
document.body = doc.body
+ document.head.querySelectorAll("style").forEach(e => document.head.removeChild(e))
+ doc.head.querySelectorAll("style").forEach(e => {
+ document.head.appendChild(e)
+ })
setupEvents()
scrollTo({
top: 0,