Kdots: Darkmode

This commit is contained in:
nathan 2024-07-11 13:33:51 -06:00
parent 54c3252c45
commit 4ef6905564
5 changed files with 20 additions and 2 deletions

View File

@ -20,6 +20,13 @@ html[data-darkmode="1"] body #egw_fw_topmenu_info_items #topmenu_info_timer:befo
html[data-darkmode="1"] body egw-app {
--application-header-text-color: var(--sl-color-neutral-700);
}
html[data-darkmode="1"] body .et2_container {
background-color: initial;
}
html[data-darkmode="1"] body .dialogFooterToolbar et2-button::part(base):not(:hover),
html[data-darkmode="1"] body et2-dialog et2-button[variant='default'][slot='footer']::part(base):not(:hover) {
background-color: var(--sl-input-background-color);
}
html[data-darkmode="1"] body .nextmatch_sortheader {
color: #96bcd9;
}

View File

@ -20,6 +20,13 @@ html[data-darkmode="1"] body {
/*** WIDGETS ***/
/* This should mostly go away with webcomponents */
.et2_container {
background-color: initial;
}
.dialogFooterToolbar et2-button::part(base):not(:hover), et2-dialog et2-button[variant='default'][slot='footer']::part(base):not(:hover) {
background-color: var(--sl-input-background-color);
}
.nextmatch_sortheader {
color: #96bcd9;
}

View File

@ -1,6 +1,6 @@
<!-- BEGIN head --><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="{lang_code}" xmlns="http://www.w3.org/1999/xhtml"{dir_code} data-darkmode={darkmode}>
<html xml:lang="{lang_code}" xmlns="http://www.w3.org/1999/xhtml"{dir_code} {theme}>
<head>
<title>{website_title}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}"/>

View File

@ -35,6 +35,10 @@ class kdots_framework extends Api\Framework\Ajax
return [];
}
$data = parent::_get_header($extra);
$data['theme'] .= $data['darkmode'] ? 'data-darkmode="1" class="sl-theme-dark"' : '';
unset($data['darkmode']);
if($extra['navbar-apps'])
{
// Fix wrong icon type

View File

@ -57,7 +57,7 @@ export class EgwDarkmodeToggle extends LitElement
{
if(force == null)
{
force = !(document.documentElement.getAttribute("data-darkmode") == "true");
force = !(document.documentElement.getAttribute("data-darkmode") == "1");
}
this.darkmode = force;
if(force)