🎨 Add data-backend and data-frontend attributes to HTML element https://github.com/siyuan-note/siyuan/issues/12549 (#16812)

This commit is contained in:
Jeffrey Chen 2026-01-14 11:35:52 +08:00 committed by GitHub
parent 6688418a47
commit bafb045143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,10 +8,13 @@ import {exportLayout} from "../layout/util";
import {fetchPost} from "./fetch";
import {isInAndroid, isInHarmony, isInIOS, isIPad, isIPhone, isMac, isWin11} from "../protyle/util/compatibility";
import {setCodeTheme} from "../protyle/render/util";
import {getBackend, getFrontend} from "./functions";
export const loadAssets = (data: Config.IAppearance) => {
const htmlElement = document.getElementsByTagName("html")[0];
htmlElement.setAttribute("lang", window.siyuan.config.appearance.lang);
htmlElement.setAttribute("data-frontend", getFrontend()); // https://github.com/siyuan-note/siyuan/issues/12549
htmlElement.setAttribute("data-backend", getBackend());
htmlElement.setAttribute("data-theme-mode", getThemeMode());
htmlElement.setAttribute("data-light-theme", window.siyuan.config.appearance.themeLight);
htmlElement.setAttribute("data-dark-theme", window.siyuan.config.appearance.themeDark);