Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/theming/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
--background-invert-if-bright: invert(100%);
--background-image-invert-if-bright: no;
--image-background: url('/core/img/app-background.jpg');
--image-background-default: url('/core/img/app-background.jpg');
--color-background-plain: #0082c9;
--primary-invert-if-bright: no;
--color-primary: #00639a;
Expand All @@ -66,6 +67,7 @@
--color-primary-light-hover: #dbe4e9;
--color-primary-text-dark: #ededed;
--color-primary-element: #00639a;
--color-primary-element-default-hover: #329bd3;
--color-primary-element-text: #ffffff;
--color-primary-element-hover: #3282ae;
--color-primary-element-light: #e5eff4;
Expand Down
2 changes: 1 addition & 1 deletion apps/theming/css/settings-admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/theming/css/settings-admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
margin-bottom: 20px;
cursor: pointer;
background-color: var(--color-primary-default);
background-image: var(--image-background, var(--image-background-plain, url('../../../core/img/app-background.jpg'), linear-gradient(40deg, #0082c9 0%, #30b6ff 100%)));
background-image: var(--image-background-default, var(--image-background-plain, url('../../../core/img/app-background.jpg'), linear-gradient(40deg, #0082c9 0%, #30b6ff 100%)));

#theming-preview-logo {
cursor: pointer;
Expand Down
11 changes: 9 additions & 2 deletions apps/theming/lib/Themes/CommonThemeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ trait CommonThemeTrait {
protected function generatePrimaryVariables(string $colorMainBackground, string $colorMainText): array {
$colorPrimaryLight = $this->util->mix($this->primaryColor, $colorMainBackground, -80);
$colorPrimaryElement = $this->util->elementColor($this->primaryColor);
$colorPrimaryElementDefault = $this->util->elementColor($this->defaultPrimaryColor);
$colorPrimaryElementLight = $this->util->mix($colorPrimaryElement, $colorMainBackground, -80);

// primary related colours
Expand All @@ -64,6 +65,7 @@ protected function generatePrimaryVariables(string $colorMainBackground, string

// used for buttons, inputs...
'--color-primary-element' => $colorPrimaryElement,
'--color-primary-element-default-hover' => $this->util->mix($colorPrimaryElementDefault, $colorMainBackground, 60),
'--color-primary-element-text' => $this->util->invertTextColor($colorPrimaryElement) ? '#000000' : '#ffffff',
'--color-primary-element-hover' => $this->util->mix($colorPrimaryElement, $colorMainBackground, 60),
'--color-primary-element-light' => $colorPrimaryElementLight,
Expand All @@ -80,16 +82,19 @@ protected function generatePrimaryVariables(string $colorMainBackground, string
* Generate admin theming background-related variables
*/
protected function generateGlobalBackgroundVariables(): array {
$user = $this->userSession->getUser();
$backgroundDeleted = $this->config->getAppValue(Application::APP_ID, 'backgroundMime', '') === 'backgroundColor';
$hasCustomLogoHeader = $this->util->isLogoThemed();

$variables = [];

// If primary as background has been request or if we have a custom primary colour
// let's not define the background image
if ($backgroundDeleted && $this->themingDefaults->isUserThemingDisabled()) {
$variables['--image-background-plain'] = 'true';
if ($backgroundDeleted) {
$variables['--color-background-plain'] = $this->themingDefaults->getColorPrimary();
if ($this->themingDefaults->isUserThemingDisabled() || $user === null) {
$variables['--image-background-plain'] = 'true';
}
}

// Register image variables only if custom-defined
Expand All @@ -99,9 +104,11 @@ protected function generateGlobalBackgroundVariables(): array {
if ($image === 'background') {
// If background deleted is set, ignoring variable
if ($backgroundDeleted) {
$variables['--image-background-default'] = 'no';
continue;
}
$variables['--image-background-size'] = 'cover';
$variables['--image-background-default'] = "url('" . $imageUrl . "')";
}
$variables["--image-$image"] = "url('" . $imageUrl . "')";
}
Expand Down
6 changes: 6 additions & 0 deletions apps/theming/lib/Themes/DarkHighContrastTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ public function getCustomCss(): string {
.menutoggle {
opacity: 1 !important;
}
#app-navigation {
border-right: 1px solid var(--color-border);
}
div.crumb {
filter: brightness(150%);
}
";
}
}
1 change: 1 addition & 0 deletions apps/theming/lib/Themes/DefaultTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public function getCSSVariables(): array {

// Default last fallback values
'--image-background' => "url('" . $this->urlGenerator->imagePath('core', 'app-background.jpg') . "')",
'--image-background-default' => "url('" . $this->urlGenerator->imagePath('core', 'app-background.jpg') . "')",
'--color-background-plain' => $this->defaultPrimaryColor,
];

Expand Down
3 changes: 3 additions & 0 deletions apps/theming/lib/Themes/HighContrastTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ public function getCustomCss(): string {
.menutoggle {
opacity: 1 !important;
}
#app-navigation {
border-right: 1px solid var(--color-border);
}
";
}
}
2 changes: 1 addition & 1 deletion apps/theming/lib/ThemingDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public function undo($setting) {
$returnValue = $this->getSlogan();
break;
case 'color':
$returnValue = $this->getColorPrimary();
$returnValue = $this->getDefaultColorPrimary();
break;
case 'logo':
case 'logoheader':
Expand Down
4 changes: 1 addition & 3 deletions apps/theming/tests/ThemingDefaultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,16 +623,14 @@ public function testUndoColor() {
->method('deleteAppValue')
->with('theming', 'color');
$this->config
->expects($this->exactly(3))
->expects($this->exactly(2))
->method('getAppValue')
->withConsecutive(
['theming', 'cachebuster', '0'],
['theming', 'color', null],
['theming', 'disable-user-theming', 'no'],
)->willReturnOnConsecutiveCalls(
'15',
$this->defaults->getColorPrimary(),
'no',
);
$this->config
->expects($this->once())
Expand Down
4 changes: 2 additions & 2 deletions core/css/guest.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
color: var(--color-text);
text-align: center;
background-color: var(--color-main-background-not-plain, var(--color-primary));
background-image: var(--image-background, var(--image-background-plain, url('../../../core/img/app-background.jpg'), linear-gradient(40deg, #0082c9 0%, #30b6ff 100%)));
background-color: var(--color-primary-default, var(--color-primary));
background-image: var(--image-background-plain, var(--image-background, url('../../../core/img/app-background.jpg'), linear-gradient(40deg, #0082c9 0%, #30b6ff 100%)));
background-attachment: fixed;
min-height: 100%; /* fix sticky footer */
height: auto;
Expand Down