1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

feat: vanilla CSS color scheme changes (#3996)

* feat: vanilla CSS color scheme changes
* chore: scheme mixin
* chore: remove darkmode & colored header less variables
* feat: high contrast schemes
This commit is contained in:
Sami Mazouz
2024-06-22 08:05:07 +01:00
committed by GitHub
parent 379298acb0
commit b91caec30b
29 changed files with 979 additions and 207 deletions

View File

@@ -0,0 +1,56 @@
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
$darkMode = $schema->getConnection()
->table('settings')
->where('key', 'theme_dark_mode')
->first();
$schema->getConnection()
->table('settings')
->insert([
[
'key' => 'color_scheme',
'value' => $darkMode === '1' ? 'dark' : 'auto',
],
[
'key' => 'allow_user_color_scheme',
'value' => '1',
]
]);
$schema->getConnection()
->table('settings')
->where('key', 'theme_dark_mode')
->delete();
},
'down' => function (Builder $schema) {
$themeMode = $schema->getConnection()
->table('settings')
->where('key', 'color_scheme')
->first();
$schema->getConnection()
->table('settings')
->insert([
'key' => 'theme_dark_mode',
'value' => $themeMode === 'dark' ? '1' : '0',
]);
$schema->getConnection()
->table('settings')
->whereIn('key', ['color_scheme', 'allow_user_color_scheme'])
->delete();
}
];