mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Enhancement: use theme-color meta tag (#8359)
This commit is contained in:
@@ -17,6 +17,8 @@ export enum GlobalSearchType {
|
||||
TITLE_CONTENT = 'title-content',
|
||||
}
|
||||
|
||||
export const PAPERLESS_GREEN_HEX = '#17541f'
|
||||
|
||||
export const SETTINGS_KEYS = {
|
||||
LANGUAGE: 'language',
|
||||
APP_LOGO: 'app_logo',
|
||||
|
@@ -17,7 +17,12 @@ import {
|
||||
hexToHsl,
|
||||
} from 'src/app/utils/color'
|
||||
import { environment } from 'src/environments/environment'
|
||||
import { UiSettings, SETTINGS, SETTINGS_KEYS } from '../data/ui-settings'
|
||||
import {
|
||||
UiSettings,
|
||||
SETTINGS,
|
||||
SETTINGS_KEYS,
|
||||
PAPERLESS_GREEN_HEX,
|
||||
} from '../data/ui-settings'
|
||||
import { User } from '../data/user'
|
||||
import {
|
||||
PermissionAction,
|
||||
@@ -420,7 +425,7 @@ export class SettingsService {
|
||||
)
|
||||
}
|
||||
|
||||
if (themeColor) {
|
||||
if (themeColor?.length) {
|
||||
const hsl = hexToHsl(themeColor)
|
||||
const bgBrightnessEstimate = estimateBrightnessForColor(themeColor)
|
||||
|
||||
@@ -445,6 +450,11 @@ export class SettingsService {
|
||||
document.documentElement.style.removeProperty('--pngx-primary')
|
||||
document.documentElement.style.removeProperty('--pngx-primary-lightness')
|
||||
}
|
||||
|
||||
this.meta.updateTag({
|
||||
name: 'theme-color',
|
||||
content: themeColor?.length ? themeColor : PAPERLESS_GREEN_HEX,
|
||||
})
|
||||
}
|
||||
|
||||
getLanguageOptions(): LanguageOption[] {
|
||||
|
Reference in New Issue
Block a user