Add some borders. Fix style override when switching pages
This commit is contained in:
@@ -47,13 +47,16 @@ onMount(() => {
|
||||
return
|
||||
}
|
||||
|
||||
// Custom CSS rules for the whole viewer
|
||||
document.documentElement.style = css_from_path(nav.path)
|
||||
// Custom CSS rules for the whole viewer. The MainMenu applies its
|
||||
// styles to the <html> element. So we apply to the <body> element, our
|
||||
// styles take precedence since they're lower level, and we can clean it
|
||||
// up afterwards without overwriting global style
|
||||
document.body.style = css_from_path(nav.path)
|
||||
})
|
||||
return () => {
|
||||
page_sub()
|
||||
nav_sub()
|
||||
document.documentElement.style = ""
|
||||
document.body.style = ""
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user