叶静 3 tygodni temu
rodzic
commit
645fbdae73

+ 29 - 4
src/assets/css/sa-reset.scss

@@ -20,9 +20,6 @@ h3,
 h4,
 h5,
 h6,
-em,
-i,
-b,
 textarea,
 button,
 input,
@@ -32,7 +29,6 @@ figcaption {
   padding: 0;
   margin: 0;
   list-style-type: none;
-  font-style: normal;
   text-decoration: none;
   border: none;
   background: none;
@@ -94,3 +90,32 @@ a:active {
 .el-button:focus {
   outline: none !important;
 }
+
+// 富文本编辑器样式覆盖
+.w-e-text-container [data-slate-editor] {
+  strong,
+  strong *,
+  b,
+  b * {
+    font-weight: bold !important;
+  }
+
+  em,
+  em *,
+  i,
+  i * {
+    font-style: italic !important;
+  }
+
+  u,
+  u * {
+    text-decoration: underline !important;
+  }
+
+  s,
+  s *,
+  strike,
+  strike * {
+    text-decoration: line-through !important;
+  }
+}

+ 26 - 0
src/sheep/components/sa-editor/sa-editor.vue

@@ -154,3 +154,29 @@ onBeforeUnmount(() => {
     }
 }
 </style>
+
+<style lang="scss">
+// 全局样式覆盖,确保富文本编辑器的加粗等样式正常显示
+.w-e-text-container [data-slate-editor] {
+
+    strong,
+    strong.token.bold,
+    b {
+        font-weight: bold !important;
+    }
+
+    em,
+    i {
+        font-style: italic !important;
+    }
+
+    u {
+        text-decoration: underline !important;
+    }
+
+    s,
+    strike {
+        text-decoration: line-through !important;
+    }
+}
+</style>