Skip to content

Commit

Permalink
Merge pull request #3855 from nextcloud/backport/3840-stable27
Browse files Browse the repository at this point in the history
[stable27] Allow passing css var to change Collabora logo color
  • Loading branch information
elzody authored Jul 30, 2024
2 parents 348938b + 7bee480 commit 0c5f19d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/helpers/coolParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ const generateCSSVarTokens = () => {
if (customLogo) {
str += ';--nc-custom-logo=' + window.OCA?.Theming?.cacheBuster ?? 0 + ';'
}

const rootEl = document.querySelector(':root')

const logoBgColor = window.getComputedStyle(rootEl).getPropertyValue('--nc-logo-background')
str += '--nc-logo-background=' + (logoBgColor === '' ? 'transparent' : logoBgColor) + ';'

const logoDisplay = window.getComputedStyle(rootEl).getPropertyValue('--nc-logo-display')
str += '--nc-logo-display=' + (logoDisplay === '' ? 'block' : logoDisplay) + ';'

return str.replace(/["']/g, '\\\'')
}

Expand Down

0 comments on commit 0c5f19d

Please sign in to comment.