埋め込みコード生成機能

This commit is contained in:
kakkokari-gtyih
2024-06-25 20:18:14 +09:00
parent 05ca36f400
commit 3bd055b045
9 changed files with 527 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ import { globalEvents } from '@/events.js';
import lightTheme from '@/themes/_light.json5';
import darkTheme from '@/themes/_dark.json5';
import { miLocalStorage } from '@/local-storage.js';
import { isEmbedPage } from '@/scripts/embed-page.js';
export type Theme = {
id: string;
@@ -95,7 +96,9 @@ export function applyTheme(theme: Theme, persist = true) {
document.documentElement.style.setProperty(`--${k}`, v.toString());
}
document.documentElement.style.setProperty('color-scheme', colorScheme);
if (!isEmbedPage()) {
document.documentElement.style.setProperty('color-scheme', colorScheme);
}
if (persist) {
miLocalStorage.setItem('theme', JSON.stringify(props));