game-programming-patterns icon indicating copy to clipboard operation
game-programming-patterns copied to clipboard

[WIP] Dark theme

Open aghArdeshir opened this issue 3 years ago • 1 comments

Hi. This PR:

  • adds a small button on top of every page. This small button is responsible for toggling between dark and light themes.
  • persists the user's current choice in the local storage, so the latest selection is persistent across page refreshes and navigations.
  • implements a (n almost) well-looking dark theme.
  • fixes two minor bugs in script.js.
  • reads changes from the user's preferences to enable dark or light themes based on the user's system preferences.

TODO:

  • Improve the structure of the asset/dark-styles.scss file to use meaningful variables and better order of styles.
  • Maybe better icons for light and dark themes.

ONLINE DEMO

https://aghardeshir.github.io/game-programming-patterns/html/command.html

VIDEO DEMO

dark-theme-for-game-programming-patterns.webm

VIDEO DEMO FOR READING THEME FROM SYSTEM SETTINGS

dark-theme-from-system.webm

aghArdeshir avatar Oct 05 '22 07:10 aghArdeshir

@munificent? You explicitly mentioned you won't be actively maintaining this repository anymore. But I thought of mentioning you, as I believe this PR is a must-have and helps in reading the book easier.

aghArdeshir avatar Nov 01 '22 11:11 aghArdeshir