giteabot backport / giteabot (push) Canceled after 0s
giteabot / giteabot (push) Canceled after 0s
release-nightly / nightly-binary (push) Canceled after 0s
release-nightly / nightly-container (push) Canceled after 0s
cache-seeder / gobuild (push) Canceled after 0s
cache-seeder / lint (bindata, lint-backend) (push) Canceled after 0s
release-nightly-snapcraft / build-and-publish (push) Canceled after 0s
Includes direct password setup links in registration emails. Assisted-by: Codex:GPT-5
15 lines
580 B
TypeScript
15 lines
580 B
TypeScript
import './polyfills.ts';
|
|
import './relative-time.ts';
|
|
import './overflow-menu.ts';
|
|
import {isDarkTheme} from '../utils.ts';
|
|
|
|
function initPageThemeDarkLight() {
|
|
// Set page's theme color preference as early as possible, to avoid flicker of wrong theme color during page load.
|
|
const sync = () => document.documentElement.setAttribute('data-gitea-theme-dark', String(isDarkTheme()));
|
|
sync();
|
|
// Track system theme changes in case Gitea is using "auto" theme.
|
|
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', sync);
|
|
}
|
|
|
|
initPageThemeDarkLight();
|