Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

enhancement: dynamic theme-color meta tag from theme brand color - #13509

Merged
LukasHirt merged 2 commits into
owncloud:masterfrom
ubermensch19:enhancement/dynamic-theme-color
Jan 22, 2026
Merged

LukasHirt merged 2 commits into
owncloud:masterfrom
ubermensch19:enhancement/dynamic-theme-color

Conversation

@ubermensch19

Copy link
Copy Markdown
Contributor

Description

Dynamic theme-color meta tag using the brand color from the loaded theme via getComputedStyle().

Related Issue

Motivation and Context

Safari uses <meta name="theme-color"> to style the tab bar. The hardcoded value didn't match custom themes.

How Has This Been Tested?

  • test environment: Local dev server, Safari macOS
  • test case 1: Verified meta tag contains resolved hex color (not CSS variable)
  • test case 2: Inspected <head> to confirm theme-color meta tag is present

Types of changes

  • New feature (non-breaking change which adds functionality)

@update-docs

update-docs Bot commented Jan 21, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@CLAassistant

CLAassistant commented Jan 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ubermensch19

Copy link
Copy Markdown
Contributor Author

@LukasHirt PTAL!


// Get brand color from CSS variable set by theme
const themeColor = ref('#375f7E')
onMounted(() => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using this hook will not respect switching theme in the account settings.

// Get brand color from CSS variable set by theme
const themeColor = ref('#375f7E')
onMounted(() => {
const brandColor = getComputedStyle(document.documentElement)

@LukasHirt LukasHirt Jan 22, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use this instead of

const themeColor = computed(
  () => currentTheme.value.designTokens.colorPalette['swatch-brand-default']
)

This would give you the exact value of the theme color and you do not need to do the getComputedStyle.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion, switched to using computed() with the theme store directly.

- Switch from onMounted + getComputedStyle to computed() with theme store
- Theme-color now updates reactively when user switches themes
@ubermensch19

Copy link
Copy Markdown
Contributor Author

@LukasHirt PTAL!

@sonarqubecloud

Copy link
Copy Markdown

@LukasHirt LukasHirt left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you! Tested on macos v26.2.

@LukasHirt
LukasHirt enabled auto-merge January 22, 2026 11:27
@LukasHirt

Copy link
Copy Markdown
Collaborator

@priyanshuharshbodhi1 before we can merge this PR, the license needs to be signed. You can do so via the CLA assistant in this PR.

@LukasHirt
LukasHirt merged commit 5f174f2 into owncloud:master Jan 22, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set meta prop "theme-color"

3 participants