Skip to content

Commit

Permalink
🎨 Vanessa219#28 code
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 authored and stevapple committed Apr 8, 2020
1 parent 4bbd745 commit 610c7ac
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@

* [open issues](https://github.com/Vanessa219/vditor/issues)

### v3.0.4 / 未发布

* [230](https://github.com/Vanessa219/vditor/pull/230) 切换 IR 模式后依然展示工具栏 `改进功能`

### v3.0.3 / 2020-03-20

* [27](https://github.com/Vanessa219/vditor/issues/27) 支持类似 Typora 的及时渲染模式 `引入特性`
Expand Down
28 changes: 24 additions & 4 deletions src/assets/scss/_ir.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@


&__node {
&[data-type="code-block"] {
&:before,
&:after {
content: ' ';
}
}

.vditor-ir__marker {
color: var(--second-color);
width: 0;
Expand All @@ -18,10 +25,6 @@
color: var(--ir-heading-color);
}

&--code {
color: var(--ir-code-color);
}

&--bi {
color: var(--ir-bi-color);
}
Expand All @@ -30,6 +33,10 @@
color: var(--ir-link-color);
}

&--title {
color: var(--ir-title-color);
}

&--bracket {
color: var(--ir-bracket-color);
text-decoration: underline;
Expand All @@ -46,6 +53,19 @@
height: auto;
width: auto;
}

&[data-type="code-block"] {
&:before,
&:after {
content: '```';
color: var(--second-color);
}
}
}

span[data-type="code-block-open-marker"],
span[data-type="code-block-close-marker"]{
display: none;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/assets/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $transition: all .15s ease-in-out !default;
--blockquote-color: #6a737d;

--ir-heading-color: #660e7a;
--ir-code-color: #808080;
--ir-title-color: #808080;
--ir-bi-color: #000080;
--ir-link-color: #008000;
--ir-bracket-color: #0000ff;
Expand Down Expand Up @@ -61,7 +61,7 @@ $transition: all .15s ease-in-out !default;
--blockquote-color: var(--toolbar-icon-color);

--ir-heading-color: #9876aa;
--ir-code-color: #808080;
--ir-title-color: #808080;
--ir-bi-color: #cc7832;
--ir-link-color: #ffc66d;
--ir-bracket-color: #287bde;
Expand Down
4 changes: 2 additions & 2 deletions src/ts/undo/IRUndo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class IRUndo {
return;
}
getSelection().getRangeAt(0).insertNode(document.createElement("wbr"));
this.undoStack[0][0].diffs[0][1] = vditor.lute.SpinVditorDOM(vditor.ir.element.innerHTML);
this.undoStack[0][0].diffs[0][1] = vditor.lute.SpinVditorIRDOM(vditor.ir.element.innerHTML);
this.lastText = this.undoStack[0][0].diffs[0][1];
if (vditor.ir.element.querySelector("wbr")) {
vditor.ir.element.querySelector("wbr").remove();
Expand All @@ -94,7 +94,7 @@ class IRUndo {
range.insertNode(document.createElement("wbr"));
}
}
const text = vditor.lute.SpinVditorDOM(vditor.ir.element.innerHTML);
const text = vditor.lute.SpinVditorIRDOM(vditor.ir.element.innerHTML);
if (vditor.ir.element.querySelector("wbr")) {
vditor.ir.element.querySelector("wbr").remove();
}
Expand Down

0 comments on commit 610c7ac

Please sign in to comment.