This commit is contained in:
parent
88f9318e0b
commit
15e40d2c2b
6 changed files with 13 additions and 10 deletions
|
@ -4,7 +4,6 @@
|
|||
<meta charset="UTF-8">
|
||||
<!-- https://electronjs.org/docs/tutorial/security#csp-meta-tag
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self'"/>-->
|
||||
<style id="editorFontSize" type="text/css"></style>
|
||||
<style id="editorAttr" type="text/css"></style>
|
||||
</head>
|
||||
<body class="fn__flex-column">
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<link rel="apple-touch-icon" href="../../icon.png">
|
||||
<style id="editorFontSize" type="text/css"></style>
|
||||
<style id="editorAttr" type="text/css"></style>
|
||||
</head>
|
||||
<body class="fn__flex-column body--window">
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<link rel="manifest" href="/manifest.webmanifest">
|
||||
<link rel="apple-touch-icon" href="../../icon.png">
|
||||
<style id="editorFontSize" type="text/css"></style>
|
||||
<style id="editorAttr" type="text/css"></style>
|
||||
</head>
|
||||
<body class="fn__flex-column">
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover">
|
||||
<link rel="manifest" href="/manifest.webmanifest">
|
||||
<style id="editorFontSize" type="text/css"></style>
|
||||
</head>
|
||||
<body class="fn__flex-column">
|
||||
<div id="loading" class="b3-dialog b3-dialog--open">
|
||||
|
|
|
@ -29,10 +29,12 @@ export const loadPlugins = async (app: App) => {
|
|||
loadPluginJS(app, item);
|
||||
css += item.css || "" + "\n";
|
||||
});
|
||||
const styleElement = document.createElement("style");
|
||||
styleElement.id = "pluginsStyle";
|
||||
styleElement.textContent = css;
|
||||
document.head.append(styleElement);
|
||||
const pluginsStyle = document.getElementById("pluginsStyle")
|
||||
if (pluginsStyle) {
|
||||
pluginsStyle.innerHTML = css;
|
||||
} else {
|
||||
document.head.insertAdjacentHTML("beforeend", `<style id="pluginsStyle">${css}</style>`);
|
||||
}
|
||||
};
|
||||
|
||||
const loadPluginJS = async (app: App, item: IPluginData) => {
|
||||
|
|
|
@ -218,14 +218,19 @@ export const setInlineStyle = (set = true) => {
|
|||
.protyle-wysiwyg .h5 img.emoji, .b3-typography h5 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.13 * 1.25)}px}
|
||||
.protyle-wysiwyg .h6 img.emoji, .b3-typography h6 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.25)}px}`;
|
||||
if (window.siyuan.config.editor.fontFamily) {
|
||||
style += `\n.b3-typography:not(.b3-typography--default), .protyle-wysiwyg, .protyle-title, .protyle-title__input{font-family: "${window.siyuan.config.editor.fontFamily}", "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols" !important;}`;
|
||||
style += `\n.b3-typography:not(.b3-typography--default), .protyle {font-family: "${window.siyuan.config.editor.fontFamily}", var(--b3-font-family)}`;
|
||||
}
|
||||
// pad 端菜单移除显示,如工作空间
|
||||
if ("ontouchend" in document) {
|
||||
style += "\n.b3-menu .b3-menu__action {opacity: 0.68;}";
|
||||
}
|
||||
if (set) {
|
||||
document.getElementById("editorFontSize").innerHTML = style;
|
||||
const siyuanStyle = document.getElementById("siyuanStyle")
|
||||
if (siyuanStyle) {
|
||||
siyuanStyle.innerHTML = style;
|
||||
} else {
|
||||
document.head.insertAdjacentHTML("beforeend", `<style id="siyuanStyle">${style}</style>`);
|
||||
}
|
||||
}
|
||||
return style;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue