Skip to content

Commit c1c676f

Browse files
authored
Merge pull request #4910 from nextcloud/make-the-logo-smaller-cream
Fix logo being too big on log in page, fix #4585
2 parents 7eb8b3c + 52f10c4 commit c1c676f

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

apps/theming/css/theming.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@
4444
/* override styles for login screen in guest.css */
4545
#header .logo,
4646
#header .logo-icon {
47-
background-size: contain;
4847
background-image: url(#{$image-logo});
48+
@if $theming-logo-mime != '' {
49+
background-size: contain;
50+
}
4951
}
5052

5153
#body-login,
@@ -111,4 +113,4 @@ input.primary {
111113
}
112114
}
113115
}
114-
}
116+
}

apps/theming/lib/ThemingDefaults.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ public function getScssVariables() {
192192

193193
$variables = [
194194
'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'",
195+
'theming-logo-mime' => "'" . $this->config->getAppValue('theming', 'logoMime', '') . "'",
196+
'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime', '') . "'"
195197
];
196198

197199
$variables['image-logo'] = "'".$this->urlGenerator->getAbsoluteURL($this->getLogo())."'";

apps/theming/tests/ThemingDefaultsTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,14 @@ public function testGetScssVariablesCached() {
499499
public function testGetScssVariables() {
500500
$this->config->expects($this->at(0))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
501501
$this->config->expects($this->at(1))->method('getAppValue')->with('theming', 'logoMime', false)->willReturn('jpeg');
502-
$this->config->expects($this->at(2))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
503-
$this->config->expects($this->at(3))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg');
502+
$this->config->expects($this->at(2))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg');
503+
$this->config->expects($this->at(3))->method('getAppValue')->with('theming', 'logoMime', false)->willReturn('jpeg');
504504
$this->config->expects($this->at(4))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
505-
$this->config->expects($this->at(5))->method('getAppValue')->with('theming', 'color', null)->willReturn($this->defaults->getColorPrimary());
506-
$this->config->expects($this->at(6))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
507-
$this->config->expects($this->at(7))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
505+
$this->config->expects($this->at(5))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg');
506+
$this->config->expects($this->at(6))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
507+
$this->config->expects($this->at(7))->method('getAppValue')->with('theming', 'color', null)->willReturn($this->defaults->getColorPrimary());
508+
$this->config->expects($this->at(8))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
509+
$this->config->expects($this->at(9))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
508510

509511
$this->util->expects($this->any())->method('invertTextColor')->with($this->defaults->getColorPrimary())->willReturn(false);
510512
$this->cache->expects($this->once())->method('get')->with('getScssVariables')->willReturn(null);
@@ -530,6 +532,8 @@ public function testGetScssVariables() {
530532

531533
$expected = [
532534
'theming-cachebuster' => '\'0\'',
535+
'theming-logo-mime' => '\'jpeg\'',
536+
'theming-background-mime' => '\'jpeg\'',
533537
'image-logo' => "'absolute-custom-logo?v=0'",
534538
'image-login-background' => "'absolute-custom-background?v=0'",
535539
'color-primary' => $this->defaults->getColorPrimary(),

0 commit comments

Comments
 (0)