${window.siyuan.languages.appearance14}
@@ -184,7 +167,6 @@ export const appearance = {
lightThemes: window.siyuan.config.appearance.lightThemes,
icons: window.siyuan.config.appearance.icons,
lang: (appearance.element.querySelector("#lang") as HTMLSelectElement).value,
- customCSS: (appearance.element.querySelector("#appearanceCustom") as HTMLInputElement).checked,
closeButtonBehavior: (appearance.element.querySelector("#closeButtonBehavior") as HTMLInputElement).checked ? 1 : 0,
nativeEmoji: (appearance.element.querySelector("#nativeEmoji") as HTMLInputElement).checked,
hideStatusBar: (appearance.element.querySelector("#hideStatusBar") as HTMLInputElement).checked,
@@ -219,9 +201,6 @@ export const appearance = {
appearance.element.querySelector("#codeSnippet").addEventListener("click", () => {
openSnippets();
});
- appearance.element.querySelector("#appearanceCustomSetting").addEventListener("click", () => {
- openColorPicker();
- });
appearance.element.querySelector("#resetLayout").addEventListener("click", () => {
resetLayout();
});
diff --git a/app/src/config/search.ts b/app/src/config/search.ts
index 29c69f9b5..fa4078368 100644
--- a/app/src/config/search.ts
+++ b/app/src/config/search.ts
@@ -47,7 +47,7 @@ export const initConfigSearch = (element: HTMLElement) => {
"appearance5", "appearance6", "appearance8", "appearance9", "appearance10", "appearance11",
"appearance14", "appearance15", "appearance16", "appearance17",
"resetLayout", "reset", "icon", "themeLight", "themeDark", "close", "themeOS", "theme",
- "theme2", "theme11", "theme12", "theme13", "theme14", "customEmoji", "customEmojiTip", "refresh"])),
+ "theme2", "theme11", "theme12", "customEmoji", "customEmojiTip", "refresh"])),
// 集市
getLang(["bazaar", "theme", "template", "icon", "widget"]),
diff --git a/app/src/config/util/colorPicker.ts b/app/src/config/util/colorPicker.ts
deleted file mode 100644
index c30d76d96..000000000
--- a/app/src/config/util/colorPicker.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-import {fetchPost} from "../../util/fetch";
-import {Dialog} from "../../dialog";
-import * as Pickr from "@simonwep/pickr";
-
-export const openColorPicker = () => {
- const theme = window.siyuan.config.appearance.mode === 0 ? window.siyuan.config.appearance.themeLight : window.siyuan.config.appearance.themeDark;
- fetchPost("/api/setting/getCustomCSS", {
- theme
- }, response => {
- let customHTML = '
';
- Object.keys(response.data).forEach((item) => {
- customHTML += `
${window.siyuan.languages[item]}
`;
- Object.keys(response.data[item]).forEach(subItem => {
- customHTML += `
-
-
- ${window.siyuan.languages[subItem]}
-
`;
- });
- });
- const dialog = new Dialog({
- width: "70vw",
- title: `${window.siyuan.languages.theme13}
${theme}`,
- content: `
${customHTML}
-
-
-
-
`
- });
- const pickrs: Record
> = {};
- dialog.element.querySelectorAll(".colorPicker").forEach((item: HTMLInputElement) => {
- // @ts-ignore
- const pickr = Pickr.create({
- container: "#appearanceCustomPanel",
- el: item,
- theme: "nano",
- default: item.getAttribute("data-value"),
- comparison: false,
- components: {
- preview: true,
- opacity: true,
- hue: true,
- interaction: {
- input: true,
- }
- }
- });
- const key = item.getAttribute("data-key");
- if (!pickrs[key]) {
- pickrs[key] = {};
- }
- pickrs[key][item.getAttribute("data-subkey")] = pickr;
- });
- dialog.element.querySelector(".b3-button--cancel").addEventListener("click", () => {
- dialog.destroy();
- });
- dialog.element.querySelector(".b3-button--text").addEventListener("click", () => {
- const css: Record> = {};
- Object.keys(pickrs).forEach((item) => {
- css[item] = {};
- Object.keys(pickrs[item]).forEach(subItem => {
- css[item][subItem] = pickrs[item][subItem].getColor().toRGBA().toString(0);
- });
- });
- fetchPost("/api/setting/setCustomCSS", {
- theme,
- css
- });
- dialog.destroy();
- });
- });
-};
diff --git a/app/src/index.ts b/app/src/index.ts
index 093b7c460..0349f0fec 100644
--- a/app/src/index.ts
+++ b/app/src/index.ts
@@ -112,9 +112,6 @@ class App {
progressBackgroundTask(data.data.tasks);
break;
case "refreshtheme":
- if (!window.siyuan.config.appearance.customCSS && data.data.theme.indexOf("custom.css") > -1) {
- return;
- }
if ((window.siyuan.config.appearance.mode === 1 && window.siyuan.config.appearance.themeDark !== "midnight") || (window.siyuan.config.appearance.mode === 0 && window.siyuan.config.appearance.themeLight !== "daylight")) {
(document.getElementById("themeStyle") as HTMLLinkElement).href = data.data.theme;
} else {
diff --git a/app/src/protyle/export/index.ts b/app/src/protyle/export/index.ts
index e0dfb3baf..609f1d582 100644
--- a/app/src/protyle/export/index.ts
+++ b/app/src/protyle/export/index.ts
@@ -76,7 +76,7 @@ const renderPDF = (id: string) => {
const isDefault = (window.siyuan.config.appearance.mode === 1 && window.siyuan.config.appearance.themeDark === "midnight") || (window.siyuan.config.appearance.mode === 0 && window.siyuan.config.appearance.themeLight === "daylight");
let themeStyle = "";
if (!isDefault) {
- themeStyle = ``;
+ themeStyle = ``;
}
// data-theme-mode="light" https://github.com/siyuan-note/siyuan/issues/7379
const html = `
@@ -89,7 +89,7 @@ const renderPDF = (id: string) => {
-
+
${themeStyle}
${window.siyuan.languages.export} PDF