Adjust light & dark themes

This commit is contained in:
Maxime Cesson 2022-08-19 16:41:42 +02:00
parent 06a8e7c866
commit 59458a7427
2 changed files with 14 additions and 5 deletions

View File

@ -15,9 +15,19 @@ elem.innerHTML = [
'</div>'
].join('');
var key = 'CRYPTPAD_STORE|colortheme'; // handle outer
if (localStorage[key] && localStorage[key] === 'dark') {
elem.classList.add('dark-theme');
}
if (!localStorage[key] && localStorage[key+'_default'] && localStorage[key+'_default'] === 'dark') {
elem.classList.add('dark-theme');
}
var req;
try {
req = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
if ((req.theme || req.themeOS) === 'dark') { // handle inner
elem.classList.add('dark-theme');
}
} catch (e) {}

View File

@ -36,12 +36,11 @@
align-items: center;
font: 20px 'Open Sans', 'Helvetica Neue', sans-serif !important;
}
@media (prefers-color-scheme: dark) {
#placeholder {
background-color: #212121; /* @cp_loading-bg (dark) */
color: #EEEEEE; /* @cp_loading-fg (dark) */
}
#placeholder.dark-theme {
background-color: #212121; /* @cp_loading-bg (dark) */
color: #EEEEEE; /* @cp_loading-fg (dark) */
}
#placeholder .placeholder-logo-container {
height: 300px;
width: 300px;