Rename mint editor theme and remove source note
This commit is contained in:
1 parent
49c59bddcc
commit
c5dccac83d
9 files changed
+131
-133
No files matched your search
@@ -230,7 +230,6 @@ If you want to migrate notes from other platforms to EdgeEver, please refer to t
|
||||
## Acknowledgements
|
||||
|
||||
- The visual design of the editor themes is inspired by [gzh-design-skill](https://github.com/isjiamu/gzh-design-skill), whose themes were originally created by Jiamu (甲木) × Moyu Xiaoli (摸鱼小李). Thanks for their open-source work.
|
||||
- The `嫩青` editor theme is adapted from the visual style of the [MDNice editor](https://editor.mdnice.com/). Thanks to the original authors for the reference.
|
||||
|
||||
## Disclaimer
|
||||
|
||||
|
||||
@@ -240,7 +240,6 @@ Cloudflare Worker 侧执行图片处理会消耗计算/图片处理额度,因
|
||||
## 致谢
|
||||
|
||||
- 编辑器主题的视觉设计参考自 [gzh-design-skill](https://github.com/isjiamu/gzh-design-skill),相关主题由甲木 × 摸鱼小李原创。感谢作者的开源工作。
|
||||
- `嫩青`编辑器主题的视觉样式参考自 [MDNice 编辑器](https://editor.mdnice.com/)。感谢原作者提供的设计参考。
|
||||
|
||||
## 免责声明
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export const EDITOR_THEME_NAMES = [
|
||||
"zen-whitespace",
|
||||
"moyu-ticket",
|
||||
"olive-journal",
|
||||
"mdnice-nenqing",
|
||||
"mint-breeze",
|
||||
] as const;
|
||||
export type EditorThemeName = (typeof EDITOR_THEME_NAMES)[number];
|
||||
|
||||
@@ -78,6 +78,7 @@ export const getStoredMermaidTheme = (): MermaidThemeName => {
|
||||
export const getStoredEditorTheme = (): EditorThemeName => {
|
||||
if (typeof window === "undefined") return "default";
|
||||
const stored = window.localStorage.getItem(EDITOR_THEME_STORAGE_KEY);
|
||||
if (stored === "mdnice-nenqing") return "mint-breeze";
|
||||
return EDITOR_THEME_NAMES.includes(stored as EditorThemeName) ? stored as EditorThemeName : "default";
|
||||
};
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ const applyInlineStyles = (root: HTMLElement, editorTheme?: string) => {
|
||||
root.querySelectorAll<HTMLElement>("[data-edgeever-theme-block]").forEach((block) => {
|
||||
const kind = block.getAttribute("data-theme-block-kind") || "intro";
|
||||
const themeStyles = THEME_BLOCK_STYLES[kind] || THEME_BLOCK_STYLES.intro;
|
||||
const accent = editorTheme === "red-white" ? "#dc2626" : editorTheme === "olive-journal" ? "#ed7b2f" : editorTheme === "graphite-minimal" ? "#52525b" : "#059669";
|
||||
const accent = editorTheme === "red-white" ? "#dc2626" : editorTheme === "olive-journal" ? "#ed7b2f" : editorTheme === "graphite-minimal" ? "#52525b" : editorTheme === "mint-breeze" ? "#00a86b" : "#059669";
|
||||
block.style.cssText = `${themeStyles.block} border-left-color: ${accent}; ${block.style.cssText}`;
|
||||
|
||||
const label = document.createElement("p");
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
@import "./zen-whitespace.css";
|
||||
@import "./moyu-ticket.css";
|
||||
@import "./olive-journal.css";
|
||||
@import "./mdnice-nenqing.css";
|
||||
@import "./mint-breeze.css";
|
||||
@@ -1,126 +0,0 @@
|
||||
/* mdnice-nenqing editor theme */
|
||||
|
||||
/* Adapted from the visual rules of MDNice's "嫩青" editor theme. */
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) {
|
||||
|
||||
--editor-theme-bg: #ffffff;
|
||||
--editor-theme-text: #595959;
|
||||
--editor-theme-muted: #595959;
|
||||
--editor-theme-heading: rgb(0 0 0 / 85%);
|
||||
--editor-theme-accent: #47c1a8;
|
||||
--editor-theme-soft: rgb(0 0 0 / 5%);
|
||||
--editor-theme-border: #47c1a8;
|
||||
--editor-theme-font: Optima, "Microsoft YaHei", "PingFang SC", serif;
|
||||
}
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror {
|
||||
|
||||
font-size: 1rem;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror p {
|
||||
|
||||
margin: 0;
|
||||
padding: 0.5rem 0;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror h1,
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror h2,
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror h3 {
|
||||
|
||||
color: var(--editor-theme-heading);
|
||||
font-family: var(--editor-theme-font);
|
||||
font-weight: 700;
|
||||
margin: 1.875rem 0 0.9375rem;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror h1 {
|
||||
|
||||
font-size: 1.75rem;
|
||||
line-height: 1.5;
|
||||
border-bottom: 2px solid #595959;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror h2 {
|
||||
|
||||
font-size: 1.5rem;
|
||||
line-height: 1.5;
|
||||
border-left: 0;
|
||||
border-bottom: 2px solid #595959;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror h3 {
|
||||
|
||||
font-size: 1.17rem;
|
||||
line-height: 1.3;
|
||||
border: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror strong,
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror a {
|
||||
|
||||
color: var(--editor-theme-accent);
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror blockquote {
|
||||
|
||||
margin: 1.25rem 0;
|
||||
border-left: 0;
|
||||
border-radius: 0;
|
||||
background: var(--editor-theme-soft);
|
||||
color: var(--editor-theme-text);
|
||||
padding: 0.625rem 0.625rem 0.625rem 1.25rem;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror ul,
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror ol {
|
||||
|
||||
margin: 0.5rem 0;
|
||||
padding-left: 1.5625rem;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror li {
|
||||
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror li::marker {
|
||||
|
||||
color: var(--editor-theme-accent);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror code {
|
||||
|
||||
border: 0;
|
||||
border-radius: 2px;
|
||||
background: rgb(27 31 35 / 5%);
|
||||
color: var(--editor-theme-accent);
|
||||
font-family: "Operator Mono", Consolas, Monaco, Menlo, monospace;
|
||||
font-size: 0.875rem;
|
||||
padding: 0.125rem 0.25rem;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror pre {
|
||||
|
||||
border: 0;
|
||||
border-radius: 0.3125rem;
|
||||
background: #f6f6f6;
|
||||
color: #595959;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror hr {
|
||||
|
||||
border-color: #808080;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mdnice-nenqing"]:not([data-editor-theme="default"]) .ProseMirror th {
|
||||
|
||||
background: rgb(71 193 168 / 12%);
|
||||
color: var(--editor-theme-heading);
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
/* mint-breeze editor theme */
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) {
|
||||
|
||||
--editor-theme-bg: #ffffff;
|
||||
--editor-theme-text: #36544a;
|
||||
--editor-theme-muted: #668277;
|
||||
--editor-theme-heading: #12372a;
|
||||
--editor-theme-accent: #00a86b;
|
||||
--editor-theme-soft: #effaf4;
|
||||
--editor-theme-border: #a7dcc8;
|
||||
--editor-theme-font: Optima, "Microsoft YaHei", "PingFang SC", serif;
|
||||
}
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror {
|
||||
|
||||
font-size: 1rem;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror p {
|
||||
|
||||
margin: 0;
|
||||
padding: 0.5rem 0;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror h1,
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror h2,
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror h3 {
|
||||
|
||||
color: var(--editor-theme-heading);
|
||||
font-family: var(--editor-theme-font);
|
||||
font-weight: 700;
|
||||
margin: 1.875rem 0 0.9375rem;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror h1 {
|
||||
|
||||
font-size: 1.75rem;
|
||||
line-height: 1.5;
|
||||
border-bottom: 2px solid #00a86b;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror h2 {
|
||||
|
||||
font-size: 1.5rem;
|
||||
line-height: 1.5;
|
||||
border-left: 0;
|
||||
border-bottom: 2px solid #00a86b;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror h3 {
|
||||
|
||||
font-size: 1.17rem;
|
||||
line-height: 1.3;
|
||||
border: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror strong,
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror a {
|
||||
|
||||
color: var(--editor-theme-accent);
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror blockquote {
|
||||
|
||||
margin: 1.25rem 0;
|
||||
border-left: 0;
|
||||
border-radius: 0;
|
||||
background: var(--editor-theme-soft);
|
||||
color: var(--editor-theme-text);
|
||||
padding: 0.625rem 0.625rem 0.625rem 1.25rem;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror ul,
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror ol {
|
||||
|
||||
margin: 0.5rem 0;
|
||||
padding-left: 1.5625rem;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror li {
|
||||
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror li::marker {
|
||||
|
||||
color: var(--editor-theme-accent);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror code {
|
||||
|
||||
border: 0;
|
||||
border-radius: 2px;
|
||||
background: #eef6f1;
|
||||
color: var(--editor-theme-accent);
|
||||
font-family: "Operator Mono", Consolas, Monaco, Menlo, monospace;
|
||||
font-size: 0.875rem;
|
||||
padding: 0.125rem 0.25rem;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror pre {
|
||||
|
||||
border: 0;
|
||||
border-radius: 0.3125rem;
|
||||
background: #f1f8f4;
|
||||
color: #36544a;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror hr {
|
||||
|
||||
border-color: #a7dcc8;
|
||||
}
|
||||
|
||||
.edgeever-editor[data-editor-theme="mint-breeze"]:not([data-editor-theme="default"]) .ProseMirror th {
|
||||
|
||||
background: rgb(0 168 107 / 12%);
|
||||
color: var(--editor-theme-heading);
|
||||
}
|
||||
@@ -157,7 +157,7 @@ export const enUS = {
|
||||
"zen-whitespace": "Zen Whitespace",
|
||||
"moyu-ticket": "Moyu Ticket",
|
||||
"olive-journal": "Olive Journal",
|
||||
"mdnice-nenqing": "Tender Green (MDNice)",
|
||||
"mint-breeze": "Mint Breeze",
|
||||
},
|
||||
mermaidThemes: {
|
||||
"zinc-light": "Zinc Light",
|
||||
|
||||
@@ -157,7 +157,7 @@ export const zhCN = {
|
||||
"zen-whitespace": "留白禅意风",
|
||||
"moyu-ticket": "摸鱼票据风",
|
||||
"olive-journal": "橄榄手记",
|
||||
"mdnice-nenqing": "嫩青(MDNice)",
|
||||
"mint-breeze": "薄荷青",
|
||||
},
|
||||
mermaidThemes: {
|
||||
"zinc-light": "Zinc 浅色",
|
||||
|
||||
Reference in new issue
Block a user