Skip to content

Commit

Permalink
Merge pull request #4910 from nextcloud/make-the-logo-smaller-cream
Browse files Browse the repository at this point in the history
Fix logo being too big on log in page, fix #4585
  • Loading branch information
LukasReschke authored May 19, 2017
2 parents 7eb8b3c + 52f10c4 commit c1c676f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
6 changes: 4 additions & 2 deletions apps/theming/css/theming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
/* override styles for login screen in guest.css */
#header .logo,
#header .logo-icon {
background-size: contain;
background-image: url(#{$image-logo});
@if $theming-logo-mime != '' {
background-size: contain;
}
}

#body-login,
Expand Down Expand Up @@ -111,4 +113,4 @@ input.primary {
}
}
}
}
}
2 changes: 2 additions & 0 deletions apps/theming/lib/ThemingDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ public function getScssVariables() {

$variables = [
'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'",
'theming-logo-mime' => "'" . $this->config->getAppValue('theming', 'logoMime', '') . "'",
'theming-background-mime' => "'" . $this->config->getAppValue('theming', 'backgroundMime', '') . "'"
];

$variables['image-logo'] = "'".$this->urlGenerator->getAbsoluteURL($this->getLogo())."'";
Expand Down
14 changes: 9 additions & 5 deletions apps/theming/tests/ThemingDefaultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,14 @@ public function testGetScssVariablesCached() {
public function testGetScssVariables() {
$this->config->expects($this->at(0))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
$this->config->expects($this->at(1))->method('getAppValue')->with('theming', 'logoMime', false)->willReturn('jpeg');
$this->config->expects($this->at(2))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
$this->config->expects($this->at(3))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg');
$this->config->expects($this->at(2))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg');
$this->config->expects($this->at(3))->method('getAppValue')->with('theming', 'logoMime', false)->willReturn('jpeg');
$this->config->expects($this->at(4))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
$this->config->expects($this->at(5))->method('getAppValue')->with('theming', 'color', null)->willReturn($this->defaults->getColorPrimary());
$this->config->expects($this->at(6))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
$this->config->expects($this->at(7))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
$this->config->expects($this->at(5))->method('getAppValue')->with('theming', 'backgroundMime', false)->willReturn('jpeg');
$this->config->expects($this->at(6))->method('getAppValue')->with('theming', 'cachebuster', '0')->willReturn('0');
$this->config->expects($this->at(7))->method('getAppValue')->with('theming', 'color', null)->willReturn($this->defaults->getColorPrimary());
$this->config->expects($this->at(8))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());
$this->config->expects($this->at(9))->method('getAppValue')->with('theming', 'color', $this->defaults->getColorPrimary())->willReturn($this->defaults->getColorPrimary());

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

$expected = [
'theming-cachebuster' => '\'0\'',
'theming-logo-mime' => '\'jpeg\'',
'theming-background-mime' => '\'jpeg\'',
'image-logo' => "'absolute-custom-logo?v=0'",
'image-login-background' => "'absolute-custom-background?v=0'",
'color-primary' => $this->defaults->getColorPrimary(),
Expand Down

0 comments on commit c1c676f

Please sign in to comment.