-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔢 Add css variables for blur background #33610
Changes from all commits
4be6280
49ddaae
57233fd
145c3be
5e55082
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,8 @@ public function getCSSVariables(): array { | |
'--color-main-background' => $colorMainBackground, | ||
'--color-main-background-rgb' => $colorMainBackgroundRGB, | ||
'--color-main-background-translucent' => 'rgba(var(--color-main-background-rgb), .97)', | ||
'--color-main-background-blur' => 'rgba(var(--color-main-background-rgb), .8)', | ||
'--filter-background-blur' => 'blur(25px)', | ||
|
||
// to use like this: background-image: linear-gradient(0, var('--gradient-main-background)); | ||
'--gradient-main-background' => 'var(--color-main-background) 0%, var(--color-main-background-translucent) 85%, transparent 100%', | ||
|
@@ -190,26 +192,30 @@ public function getCSSVariables(): array { | |
'--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'; | ||
// If primary as background has been request or if we have a custom primary colour | ||
// 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 . "')"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate of the line 216, no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, --image-main-background has a fallback to the cloud image, while the other one --image-background only represents just the theming image. |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,9 @@ public function getCSSVariables(): array { | |
$variables['--color-background-dark'] = $this->util->darken($colorMainBackground, 30); | ||
$variables['--color-background-darker'] = $this->util->darken($colorMainBackground, 30); | ||
|
||
$variables['--color-main-background-blur'] = $colorMainBackground; | ||
$variables['--filter-background-blur'] = 'none'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
|
||
$variables['--color-placeholder-light'] = $this->util->darken($colorMainBackground, 30); | ||
$variables['--color-placeholder-dark'] = $this->util->darken($colorMainBackground, 45); | ||
|
||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we customize that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be overwriten further down with the theming image. Taking the customised dashboard image into account will be a follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right I get it now!
Could use a tad more comments 😉