diff options
author | Simon L <szaimen@e.mail.de> | 2022-10-13 20:57:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-13 20:57:28 +0300 |
commit | b28757fddc90f753412bfe80baa1964e7ae912db (patch) | |
tree | 50e9032a9e7b4a2e915a2e50b8608d3b86f7cb3e /apps/theming/lib/Themes | |
parent | dff4f8a5e4dce3b14f86b03557cedb063c12d5ad (diff) | |
parent | 2f8601a27edc1d63b2607539982e8959533f0f40 (diff) |
Merge pull request #34437 from nextcloud/feat/theming-default-system-value
Use default system primary
Diffstat (limited to 'apps/theming/lib/Themes')
-rw-r--r-- | apps/theming/lib/Themes/CommonThemeTrait.php | 1 | ||||
-rw-r--r-- | apps/theming/lib/Themes/DefaultTheme.php | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/apps/theming/lib/Themes/CommonThemeTrait.php b/apps/theming/lib/Themes/CommonThemeTrait.php index 631879ea832..d88a6a319fb 100644 --- a/apps/theming/lib/Themes/CommonThemeTrait.php +++ b/apps/theming/lib/Themes/CommonThemeTrait.php @@ -42,6 +42,7 @@ trait CommonThemeTrait { // primary related colours return [ '--color-primary' => $this->primaryColor, + '--color-primary-default' => $this->defaultPrimaryColor, '--color-primary-text' => $this->util->invertTextColor($this->primaryColor) ? '#000000' : '#ffffff', '--color-primary-hover' => $this->util->mix($this->primaryColor, $colorMainBackground, 60), '--color-primary-light' => $colorPrimaryLight, diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php index e295d5d880a..4dce1dca809 100644 --- a/apps/theming/lib/Themes/DefaultTheme.php +++ b/apps/theming/lib/Themes/DefaultTheme.php @@ -48,6 +48,7 @@ class DefaultTheme implements ITheme { public IConfig $config; public IL10N $l; + public string $defaultPrimaryColor; public string $primaryColor; public function __construct(Util $util, @@ -65,9 +66,13 @@ class DefaultTheme implements ITheme { $this->config = $config; $this->l = $l; - $initialPrimaryColor = $this->themingDefaults->getColorPrimary(); - // Override default color if set to improve accessibility - $this->primaryColor = $initialPrimaryColor === BackgroundService::DEFAULT_COLOR ? BackgroundService::DEFAULT_ACCESSIBLE_COLOR : $initialPrimaryColor; + $this->defaultPrimaryColor = $this->themingDefaults->getDefaultColorPrimary(); + $this->primaryColor = $this->themingDefaults->getColorPrimary(); + + // Override default defaultPrimaryColor if set to improve accessibility + if ($this->primaryColor === BackgroundService::DEFAULT_COLOR) { + $this->primaryColor = BackgroundService::DEFAULT_ACCESSIBLE_COLOR; + } } public function getId(): string { |