pgaskin / ePubViewer

ePub viewer with dictionary, themes, search, offline support, and more
http://pgaskin.net/ePubViewer
MIT License
345 stars 75 forks source link

How did you achieve toggling between multiple styles? #15

Closed ishank-dev closed 4 years ago

ishank-dev commented 4 years ago

I am working on a similar project and I don't seem to figure out how to achieve toggling and selecting a combination of styles. When I choose a specific style it overwrites the previously applied style for eg. Selecting Dark Mode and then selecting a smaller font only makes the font smaller and it overwriting the dark mode. Here is how I am applying various styles

document.getElementById("darkTheme").addEventListener("click", function(){
    rendition.themes.register("dark", "themes.css");
    rendition.themes.select("dark");
});

Similar to this I have created multiple themes and then I am selecting them at an onclick event listener. Please help me out with this :pray: I really need to get this project done PS : You made a really Great Epub Reader :)