1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-09-09 20:56:34 +02:00
Files
api
chat
docs
draw
locale
logs
participation
registration
tfjm
helloasso
static
bootstrap
bootstrap-select
fontawesome
jquery
Fiche_sanitaire.pdf
Fiche_synthèse.docx
Fiche_synthèse.odt
Fiche_synthèse.pdf
Fiche_synthèse.tex
favicon.ico
logo.png
logo_animath.png
logo_animath.svg
main.js
tfjm.svg
theme.js
templates
__init__.py
asgi.py
lists.py
middlewares.py
permissions.py
routing.py
settings.py
settings_dev.py
settings_prod.py
tests.py
tokens.py
urls.py
views.py
wsgi.py
.bashrc
.dockerignore
.gitignore
.gitlab-ci.yml
Dockerfile
LICENSE
README.md
entrypoint.sh
manage.py
nginx_tfjm.conf
requirements.txt
tfjm.cron
tox.ini
plateforme-tfjm2/tfjm/static/theme.js
2023-02-20 23:02:09 +01:00

27 lines
803 B
JavaScript

/*!
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors
* Licensed under the Creative Commons Attribution 3.0 Unported License.
*/
(() => {
'use strict'
const getPreferredTheme = () => {
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}
const setTheme = function (theme) {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
} else {
document.documentElement.setAttribute('data-bs-theme', theme)
}
}
setTheme(getPreferredTheme())
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
setTheme(getPreferredTheme())
})
})()