From 2f5ae5b1cbe96b80274ba50dacffa0f6ab707066 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Fri, 4 Oct 2024 00:26:37 +0300 Subject: [PATCH] [main] refactoring for skeleton stylesheet --- apps/common/main/lib/util/themeinit.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/util/themeinit.js b/apps/common/main/lib/util/themeinit.js index 8628018f90..7b8f7484a0 100644 --- a/apps/common/main/lib/util/themeinit.js +++ b/apps/common/main/lib/util/themeinit.js @@ -97,6 +97,7 @@ objtheme = JSON.parse(objtheme); } + const header_tokens = ['toolbar-header-document', 'toolbar-header-spreadsheet', 'toolbar-header-presentation', 'toolbar-header-pdf']; if ( objtheme ) { if ( window.uitheme.id && window.uitheme.id != objtheme.id ) { local_storage_available && localstorage.removeItem("ui-theme"); @@ -108,8 +109,7 @@ } if ( objtheme.colors ) { - ['toolbar-header-document', 'toolbar-header-spreadsheet', 'toolbar-header-presentation', 'toolbar-header-pdf'] - .forEach(function (i) { + header_tokens.forEach(function (i) { !!objtheme.colors[i] && document.documentElement.style.setProperty('--' + i, objtheme.colors[i]); }); @@ -121,6 +121,12 @@ inject_style_tag('.' + objtheme.id + '{' + colors.join(';') + ';}'); } } + } else { + if ( window.uitheme.id.lastIndexOf("gray-theme", 0) === 0 ) { + header_tokens.forEach(function (i) { + !!document.documentElement.style.setProperty('--' + i, "#f7f7f7"); + }); + } } } }();