啊,2.8.5 之后 custom.css 终于跪了
如果你之前有用过它的话,用这个给它挽个尊吧.....
async function callback() {
let currentThemeElement =
document.querySelector("#themeStyle") ||
document.querySelector("#themeDefaultStyle");
let currentThemeURL = currentThemeElement.getAttribute("href").split("?")[0];
if (!document.querySelector("#themeCustomStyle")) {
let customThemeStyle = document.createElement("link");
customThemeStyle.setAttribute("id", "themeCustomStyle");
customThemeStyle.setAttribute("type", "text/css");
customThemeStyle.setAttribute("rel", "stylesheet");
customThemeStyle.setAttribute(
"href",
currentThemeURL.replace("theme.css", "custom.css")
);
document.head.appendChild(customThemeStyle);
} else {
if (
document.querySelector("#themeCustomStyle").getAttribute('href') !==
currentThemeURL.replace("theme.css", "custom.css")
) {
document
.querySelector("#themeCustomStyle")
.setAttribute(
"href",
currentThemeURL.replace("theme.css", "custom.css")
);
document.head.appendChild(document.querySelector("#themeCustomStyle"));
}
}
setTimeout(callback, 200);
}
setTimeout(callback, 200);
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于