Skip to content
Discussion options

You must be logged in to vote

Here is a more targeted example to your needs @syeda-git:
issues-instant.zip

In the extra.js write:

https://squidfunk.github.io/mkdocs-material/customization/#additional-javascript

let __gStyles;

// Subscribe to the document$ to know that there was a site reload
// Restore the removed style from the global variable
window.document$.subscribe(function() {
    if (!__gStyles) return;
    if (document.head.querySelector("#onetrust-style")) return;
    document.head.insertAdjacentElement("beforeend", __gStyles);
})

// Subscribe to the location$ to know that the location change was invoked
// On first location change get the style (it's not removed yet) and assign it to the global variable
w…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
2 replies
@kamilkrzyskow
Comment options

@squidfunk
Comment options

Comment options

You must be logged in to vote
6 replies
@squidfunk
Comment options

@squidfunk
Comment options

@kamilkrzyskow
Comment options

Answer selected by syeda-git
@syeda-git
Comment options

@kamilkrzyskow
Comment options

@syeda-git
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants