In JavaScript è semplice abilitare e disabilitare i fogli di stile CSS.
La soluzione è la seguente:
'use strict';
const disableStyles = () => {
for(let i = 0; i < document.styleSheets.length; i++) {
document.styleSheets[i].disabled = true;
}
};
const enableStyles = () => {
for(let i = 0; i < document.styleSheets.length; i++) {
document.styleSheets[i].disabled = false;
}
};