Switching html theme - jackdarker/TwineTest GitHub Wiki

Maybe you want to give the user a choice to select a color-theme of your game. There are different approaches possible.

disable/enable link to css

  • create your different style sheets in directory .dist/styles
  • in src/head-content.html create links to those styles

Then you simply have toggle the disable attribute via javascript to make the stylesheet take effect.
For this I use styleSwitcher.js

programmatically add style data globally

you could also create stylesection in DOM-tree directly. This gives more possibilities then toggling stylesheets.