Signed-off-by: dartcafe <github@dartcafe.de>
This commit is contained in:
dartcafe 2021-03-13 23:33:11 +01:00
Родитель 8f1d014356
Коммит e4da9e2c77
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: CCE73CEF3035D3C8
1 изменённых файлов: 25 добавлений и 2 удалений

Просмотреть файл

@ -1,4 +1,27 @@
function detectColorScheme() {
/*
* @copyright Copyright (c) 2019 Rene Gieling <github@dartcafe.de>
*
* @author Rene Gieling <github@dartcafe.de>
* @author Julius Härtl <jus@bitgrid.net>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
const detectColorScheme = function() {
if (!window.matchMedia) {
return true
} else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
@ -7,4 +30,4 @@ function detectColorScheme() {
}
}
export default { detectColorScheme }
export default detectColorScheme