I'm implementing a high-contrast mode, and for that, I'm using the following structure:
To call high contrast:
<li><a href="#" class="seleciona-estilo" data-classe="classe-azul">MODO ESCURO</a></li>
Javascript that adds CSS
<script>
$(".seleciona-estilo").on("click", function(e){
e.preventDefault();
$("link").attr("href", "ei-modo-escuro.css");
});
</script>
My question is: when I click on the "Dark Mode" button, the page loads the CSS in question and everything goes as planned, but the other previous CSS settings are lost (like fonts, positioning, and so on). What I want is just that "Dark Mode" replace the colors of background-color and color , without overlapping all others that I do not want to change. Is this possible?
Thank you in advance! =]