Started work on supporting a dark-mode

- Most elements done, but still need to do editors, tables and final
pass.
- Toggled only by quick js check at the moment, checking via css media
query. Need to make into user-preference toggle.

For #1234
This commit is contained in:
Dan Brown
2020-04-10 22:38:29 +01:00
parent d4df18098f
commit 1ba5a1274c
16 changed files with 149 additions and 56 deletions

View File

@ -191,7 +191,8 @@ function getMode(suggestion, content) {
* @returns {*|string}
*/
function getTheme() {
return window.codeTheme || 'default';
const darkMode = document.documentElement.classList.contains('dark-mode');
return window.codeTheme || (darkMode ? 'darcula' : 'default');
}
/**