From bd9c78d0d213a3f9de7264f2dd850fe5195864ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 16 Aug 2023 14:30:15 +0200 Subject: [PATCH] fix: Proper invert colors for dark mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/helpers/coolParameters.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/helpers/coolParameters.js b/src/helpers/coolParameters.js index 134184edce..af0c55d786 100644 --- a/src/helpers/coolParameters.js +++ b/src/helpers/coolParameters.js @@ -85,6 +85,11 @@ const generateCSSVarTokens = () => { // Skip extracting css vars if we cannot access parent } + const primaryText = window.getComputedStyle(element).getPropertyValue('--color-primary-text') + if (primaryText.trim() === '#ffffff') { + str += '--nc-dark-primary-invert-if-dark=invert(100%);--nc-dark-primary-invert-if-bright=none;' + } + const customLogo = loadState('richdocuments', 'theming-customLogo', false) if (customLogo) { str += ';--nc-custom-logo=' + window.OCA?.Theming?.cacheBuster ?? 0 + ';'