瀏覽代碼

:art: fix https://github.com/siyuan-note/siyuan/issues/10286

Vanessa 1 年之前
父節點
當前提交
369ef417e6
共有 3 個文件被更改,包括 6 次插入9 次删除
  1. 1 0
      app/src/assets/scss/component/_typography.scss
  2. 4 1
      app/src/assets/scss/util/_reset.scss
  3. 1 8
      app/src/util/assets.ts

+ 1 - 0
app/src/assets/scss/component/_typography.scss

@@ -15,6 +15,7 @@
     margin: 0 auto;
 
     &.emoji {
+      width: 1lh;
       cursor: auto;
       max-width: none;
       vertical-align: sub; // text-top windows 不兼容

+ 4 - 1
app/src/assets/scss/util/_reset.scss

@@ -171,7 +171,10 @@ img {
   height: auto;
   -ms-interpolation-mode: bicubic;
   overflow: hidden;
-  font-size: 12px;
+
+  &:not(.emoji) {
+    font-size: 12px;
+  }
 }
 
 button,

+ 1 - 8
app/src/util/assets.ts

@@ -216,14 +216,7 @@ export const setInlineStyle = (set = true) => {
 .protyle-wysiwyg [data-node-id] [spellcheck] {min-height:${height}px;}
 .protyle-wysiwyg [data-node-id] {${window.siyuan.config.editor.rtl ? " direction: rtl;" : ""}${window.siyuan.config.editor.justify ? " text-align: justify;" : ""}}
 .protyle-wysiwyg .li {min-height:${height + 8}px}
-.protyle-gutters button svg {height:${height}px}
-.protyle-wysiwyg img.emoji, .b3-typography img.emoji {width:${height - 8}px}
-.protyle-wysiwyg .h1 img.emoji, .b3-typography h1 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.75 * 1.25)}px}
-.protyle-wysiwyg .h2 img.emoji, .b3-typography h2 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.55 * 1.25)}px}
-.protyle-wysiwyg .h3 img.emoji, .b3-typography h3 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.38 * 1.25)}px}
-.protyle-wysiwyg .h4 img.emoji, .b3-typography h4 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.25 * 1.25)}px}
-.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}`;
+.protyle-gutters button svg {height:${height}px}`;
     if (window.siyuan.config.editor.fontFamily) {
         style += `\n.b3-typography:not(.b3-typography--default), .protyle-wysiwyg, .protyle-title {font-family: "${window.siyuan.config.editor.fontFamily}", var(--b3-font-family-protyle)}`;
     }