Fix not reflecting custom theme color

This commit is contained in:
Dominik Mielcarek 2023-09-12 23:33:53 +02:00 committed by shamoon
parent ea3a2b91e5
commit 5573c224d3
2 changed files with 16 additions and 1 deletions

View File

@ -138,6 +138,16 @@ export class SettingsService {
'--pngx-primary-lightness', '--pngx-primary-lightness',
`${hsl.l * 100}%`, `${hsl.l * 100}%`,
RendererStyleFlags2.DashCase RendererStyleFlags2.DashCase
);
/**
* Fix for not reflecting changed variables. (--bs-primary is at :root while here we set them to body)
*/
this._renderer.setStyle(
document.body,
'--bs-primary',
'hsl(var(--pngx-primary), var(--pngx-primary-lightness))',
RendererStyleFlags2.DashCase
) )
} else { } else {
this._renderer.removeStyle( this._renderer.removeStyle(
@ -150,6 +160,11 @@ export class SettingsService {
'--pngx-primary-lightness', '--pngx-primary-lightness',
RendererStyleFlags2.DashCase RendererStyleFlags2.DashCase
) )
this._renderer.removeStyle(
document.body,
'--bs-primary',
RendererStyleFlags2.DashCase
)
} }
} }

View File

@ -275,7 +275,7 @@ $form-check-radio-checked-bg-image-dark: url("data:image/svg+xml,<svg xmlns='htt
} }
@include color-mode(dark) { @include color-mode(dark) {
&:not(.primary-light):not(.primary-dark) { body:not(.primary-light):not(.primary-dark) {
@include paperless-green-dark-mode; @include paperless-green-dark-mode;
.navbar.bg-primary { .navbar.bg-primary {