Skip to content

Commit 62a92f8

Browse files
committed
fix修复编辑器css
1 parent 8e4fd72 commit 62a92f8

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ v1.4.0 发布日期:2019-11-02
77
- 修复 Safari 无法复制问题
88
- 新增主题「极客黑」、「简」
99
- 修改主题「蓝山」为「前端之巅同款」
10+
- 新增快捷键
1011

1112
v1.3.1 发布日期:2019-10-28
1213

src/layout/StyleEditor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ class StyleEditor extends Component {
2626
getStyleInstance = (instance) => {
2727
if (instance) {
2828
this.styleEditor = instance.editor;
29-
this.styleEditor.on("keyup", (cm, e) => {
30-
if ((e.keyCode >= 65 && e.keyCode <= 90) || e.keyCode === 189) {
31-
cm.showHint(e);
29+
this.styleEditor.on("keyup", (cm, event) => {
30+
if ((event.keyCode >= 65 && event.keyCode <= 90) || event.keyCode === 189) {
31+
cm.showHint({completeSingle: false});
3232
}
3333
});
3434
}

src/utils/mdMirror.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
.cm-s-md-mirror div.CodeMirror-selected {
1919
background: #e0e0e0;
2020
}
21+
22+
.cm-s-md-mirror pre.CodeMirror-line {
23+
word-break: break-all;
24+
}
25+
2126
.cm-s-md-mirror .CodeMirror-line::selection,
2227
.cm-s-md-mirror .CodeMirror-line > span::selection,
2328
.cm-s-md-mirror .CodeMirror-line > span > span::selection {

src/utils/styleMirror.css

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,25 @@
9898
background: #dddcdc;
9999
}
100100
.cm-s-style-mirror .CodeMirror-matchingbracket {
101-
color: rgb(32,32,32) !important;
102-
background-color: rgba(0,0,0,0.1) !important;
101+
color: rgb(32, 32, 32) !important;
102+
background-color: rgba(0, 0, 0, 0.1) !important;
103+
}
104+
105+
.CodeMirror-hints {
106+
background-color: rgb(245, 245, 245);
107+
font-size: 14px;
108+
font-family: 'source-code-pro', Menlo, 'Courier New', Consolas, monospace;
109+
}
110+
111+
.CodeMirror-hints li {
112+
line-height: 20px;
113+
}
114+
115+
li.CodeMirror-hint-active {
116+
color: black;
117+
background-color: rgb(202,222,185);
118+
}
119+
120+
.CodeMirror-hints li:hover {
121+
background-color: rgb(224, 224, 224);
103122
}

0 commit comments

Comments
 (0)