I am making a Flask website and trying to implement an 'Accessibility settings' bar for the users so that they can adjust the colour contrast, font-size and letter-spacing throughout the page.
However, the styles are only being applied to the current page and when I come back to the initial page the new styling doesn't exist. Is this because the server is causing the stylesheet to reload every time that I change page? Could AJAX help my situation?
Here is my current Javascript:
function settings(element, degree) {
const page = document.getElementsByTagName('*');
if (degree == "low") {
for (i = 0; i < page.length; i++) {
page[i].style.filter = "contrast(80%)";
console.log(page[i]);
}
}
}