Skip to content

Commit

Permalink
IONOS(theming): replace light theme with ionos-theme stub
Browse files Browse the repository at this point in the history
in order to override default css vars later.

regenerate autoload with composer v2.5.8 (in order to minimize changes footprint):
cd apps/theming/composer/
wget https://getcomposer.org/download/2.5.8/composer.phar
php composer.phar dump-autoload

Signed-off-by: Misha M.-Kupriyanov <[email protected]>
  • Loading branch information
printminion-co committed Sep 11, 2024
1 parent 53352c2 commit b1f9a92
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/theming/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'OCA\\Theming\\Themes\\DefaultTheme' => $baseDir . '/../lib/Themes/DefaultTheme.php',
'OCA\\Theming\\Themes\\DyslexiaFont' => $baseDir . '/../lib/Themes/DyslexiaFont.php',
'OCA\\Theming\\Themes\\HighContrastTheme' => $baseDir . '/../lib/Themes/HighContrastTheme.php',
'OCA\\Theming\\Themes\\Ionos\\LightTheme' => $baseDir . '/../lib/Themes/Ionos/LightTheme.php',
'OCA\\Theming\\Themes\\LightTheme' => $baseDir . '/../lib/Themes/LightTheme.php',
'OCA\\Theming\\ThemingDefaults' => $baseDir . '/../lib/ThemingDefaults.php',
'OCA\\Theming\\Util' => $baseDir . '/../lib/Util.php',
Expand Down
1 change: 1 addition & 0 deletions apps/theming/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ComposerStaticInitTheming
'OCA\\Theming\\Themes\\DefaultTheme' => __DIR__ . '/..' . '/../lib/Themes/DefaultTheme.php',
'OCA\\Theming\\Themes\\DyslexiaFont' => __DIR__ . '/..' . '/../lib/Themes/DyslexiaFont.php',
'OCA\\Theming\\Themes\\HighContrastTheme' => __DIR__ . '/..' . '/../lib/Themes/HighContrastTheme.php',
'OCA\\Theming\\Themes\\Ionos\\LightTheme' => __DIR__ . '/..' . '/../lib/Themes/Ionos/LightTheme.php',
'OCA\\Theming\\Themes\\LightTheme' => __DIR__ . '/..' . '/../lib/Themes/LightTheme.php',
'OCA\\Theming\\ThemingDefaults' => __DIR__ . '/..' . '/../lib/ThemingDefaults.php',
'OCA\\Theming\\Util' => __DIR__ . '/..' . '/../lib/Util.php',
Expand Down
4 changes: 2 additions & 2 deletions apps/theming/lib/Service/ThemesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
use OCA\Theming\Themes\DefaultTheme;
use OCA\Theming\Themes\DyslexiaFont;
use OCA\Theming\Themes\HighContrastTheme;
use OCA\Theming\Themes\LightTheme;
use OCA\Theming\Themes\Ionos\LightTheme;
use OCP\IConfig;
use OCP\IUser;
use OCP\IUserSession;
Expand Down Expand Up @@ -143,7 +143,7 @@ public function disableTheme(ITheme $theme): array {
$this->setEnabledThemes($enabledThemes);
return $enabledThemes;
}

return $themesIds;
}

Expand Down
53 changes: 53 additions & 0 deletions apps/theming/lib/Themes/Ionos/LightTheme.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileLicenseText: 2024 STRATO AG
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Theming\Themes\Ionos;

use OCA\Theming\ITheme;
use OCA\Theming\Themes\DefaultTheme;

class LightTheme extends DefaultTheme implements ITheme {

public function getId(): string {
return 'ionos-light';
}

public function getTitle(): string {
return $this->l->t('IONOS light theme');
}

public function getEnableLabel(): string {
return $this->l->t('Enable IONOS light theme');
}

public function getDescription(): string {
return $this->l->t('The IONOS light appearance.');
}

public function getMediaQuery(): string {
return '(prefers-color-scheme: light)';
}

public function getMeta(): array {
// https://html.spec.whatwg.org/multipage/semantics.html#meta-color-scheme
return [[
'name' => 'color-scheme',
'content' => 'light',
]];
}

public function getCSSVariables(): array {
$defaultVariables = parent::getCSSVariables();

return array_merge(
$defaultVariables,
[
]
);
}
}

0 comments on commit b1f9a92

Please sign in to comment.