diff --git a/conf/manifest.json b/conf/manifest.json index f7e98b97f..891bd79fb 100644 --- a/conf/manifest.json +++ b/conf/manifest.json @@ -1,4 +1,3 @@ { - "display": "standalone", - "background_color": "#ffffff" + "display": "standalone" } diff --git a/lib/exe/manifest.php b/lib/exe/manifest.php index 5f22f1ccf..d9d3e20b5 100644 --- a/lib/exe/manifest.php +++ b/lib/exe/manifest.php @@ -27,6 +27,18 @@ class Manifest { $manifest['start_url'] = DOKU_REL; } + $styleUtil = new \dokuwiki\StyleUtils(); + $styleIni = $styleUtil->cssStyleini($conf['template']); + $replacements = $styleIni['replacements']; + + if (empty($manifest['background_color'])) { + $manifest['background_color'] = $replacements['__background__']; + } + + if (empty($manifest['theme_color'])) { + $manifest['theme_color'] = !empty($replacements['__theme_color__']) ? $replacements['__theme_color__'] : $replacements['__background_alt__']; + } + if (empty($manifest['icons'])) { $manifest['icons'] = []; $look = [ diff --git a/lib/tpl/dokuwiki/lang/en/lang.php b/lib/tpl/dokuwiki/lang/en/lang.php index b7b3e7fa1..7c890c651 100644 --- a/lib/tpl/dokuwiki/lang/en/lang.php +++ b/lib/tpl/dokuwiki/lang/en/lang.php @@ -10,3 +10,4 @@ $lang['__site_width__'] = 'The width of the full site (can be any length unit $lang['__sidebar_width__'] = 'The width of the sidebar, if any (can be any length unit: %, px, em, ...)'; $lang['__tablet_width__'] = 'Below screensizes of this width, the site switches to tablet mode'; $lang['__phone_width__'] = 'Below screensizes of this width, the site switches to phone mode'; +$lang['__theme_color__'] = 'Theme color of the web app'; diff --git a/lib/tpl/dokuwiki/style.ini b/lib/tpl/dokuwiki/style.ini index 892a6a6e5..ca6de6aa1 100644 --- a/lib/tpl/dokuwiki/style.ini +++ b/lib/tpl/dokuwiki/style.ini @@ -85,3 +85,5 @@ __sidebar_width__ = "16em" ; @ini_sidebar_width ; cut off points for mobile devices __tablet_width__ = "800px" ; @ini_tablet_width __phone_width__ = "480px" ; @ini_phone_width + +__theme_color__ = "#008800" ; @_ini_theme_color: theme_color of the web app