mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
Expose core background image
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
49ddaaecbf
commit
57233fd99a
3 changed files with 9 additions and 4 deletions
|
|
@ -170,8 +170,9 @@ export default {
|
|||
|| this.background.match(/#[0-9A-Fa-f]{6}/g)) {
|
||||
return null
|
||||
}
|
||||
|
||||
return {
|
||||
backgroundImage: `url(${this.backgroundImage})`,
|
||||
backgroundImage: this.background === 'default' ? 'var(--image-main-background)' : `url(${this.backgroundImage})`,
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -192,6 +192,8 @@ class DefaultTheme implements ITheme {
|
|||
'--primary-invert-if-bright' => $this->util->invertTextColor($this->primaryColor) ? 'invert(100%)' : 'no',
|
||||
'--background-invert-if-dark' => 'no',
|
||||
'--background-invert-if-bright' => 'invert(100%)',
|
||||
|
||||
'--image-main-background' => "url('" . $this->urlGenerator->imagePath('core', 'app-background.jpg') . "')",
|
||||
];
|
||||
|
||||
$backgroundDeleted = $this->config->getAppValue('theming', 'backgroundMime', '') === 'backgroundColor';
|
||||
|
|
@ -199,19 +201,21 @@ class DefaultTheme implements ITheme {
|
|||
// let's not define the background image
|
||||
if ($backgroundDeleted || $hasCustomPrimaryColour) {
|
||||
$variables["--image-background-plain"] = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
// Register image variables only if custom-defined
|
||||
foreach(['logo', 'logoheader', 'favicon', 'background'] as $image) {
|
||||
if ($this->imageManager->hasImage($image)) {
|
||||
$imageUrl = $this->imageManager->getImageUrl($image);
|
||||
if ($image === 'background') {
|
||||
// If background deleted is set, ignoring variable
|
||||
if ($backgroundDeleted) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
$variables['--image-background-size'] = 'cover';
|
||||
$variables['--image-main-background'] = "url('" . $imageUrl . "')";
|
||||
}
|
||||
$variables["--image-$image"] = "url('".$this->imageManager->getImageUrl($image)."')";
|
||||
$variables["--image-$image"] = "url('" . $imageUrl . "')";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
BIN
core/img/app-background.jpg
Normal file
BIN
core/img/app-background.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 186 KiB |
Loading…
Reference in a new issue