Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: 默认主题和暗黑主题样式精调 #845

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion src/sass/cherry.scss
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
}

&:hover {
background: rgba(0, 0, 0, 0.05);
background: #ced4da;

.ch-icon {
color: $toolbarBtnColorLight;
Expand Down
5 changes: 3 additions & 2 deletions src/sass/markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,9 @@
padding: 0.1em;
border-radius: 0.3em;
white-space: normal;
color: #f85353;
background-color: #e5e5e5;
color: #495057;
background-color: #e9ecef;
border: 1px solid #ced4da;

[data-inline-code-theme='black'] & {
color: #3f4a56;
Expand Down
30 changes: 16 additions & 14 deletions src/sass/themes/dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ $sidebarShadow: $shadow;
$editorBg: rgb(37, 37, 38);
$editorColor: rgb(200, 200, 200);
$editorSelectedBg: $toolbarBtnBgHover;
$editorUrlBg: rgba(81,56,56,1);
$editorUrlBg: #343a40;
$editorCursorColor: rgb(255,255,255);
$editorImportantColor: rgb(247, 133, 83);
$editorCodeColor: rgb(255, 203, 107);
$editorImportantColor: #e9ecef;
$editorCodeColor: $editorImportantColor;
/** 预览区域样式 */
$previewBg: rgb(51, 51, 51);
$previewMobileBgColor: $editorBg;
/** markdown样式 */
$mdColor: $editorColor;
$mdHeaderColor: $editorImportantColor;
$mdLineColor: rgb(105, 105, 105);
$mdAColor: $editorCodeColor;
$mdAColor: #ced4da;
$mdAHoverColor: $editorImportantColor;
$mdInlineCodeColor: $editorCodeColor;
$mdInlineCodeBg: $editorUrlBg;
$mdInlineCodeColor: $editorColor;
$mdInlineCodeBg: #212529;
$mdSvgTextColor: rgb(250, 160, 0);
/** 编辑器样式 */
.cherry.theme__dark {
Expand Down Expand Up @@ -144,20 +144,21 @@ $mdSvgTextColor: rgb(250, 160, 0);
.cherry-toc-head {
i {
&:hover {
color: $toolbarColorItemHoverBorderColor;
color: $toolbarBtnHoverColor;
}
}
}
.cherry-toc-list {
.cherry-toc-one-a {
border-left-color: rgb(247, 133, 83, 0.3);
color:#343a40;
border-left-color: #868e96;
&.current {
border-left-color: rgb(255, 100, 33);
color: rgb(255, 100, 33);
border-left-color: $toolbarBtnHoverColor;
color: #000;
}
&:hover {
border-left-color: rgb(247, 162, 14);
color: rgb(255, 100, 33);
border-left-color: #ced4da;
color: #000;
}
}
}
Expand All @@ -180,7 +181,7 @@ $mdSvgTextColor: rgb(250, 160, 0);
}
.ch-icon-chevronsLeft {
display: inline;
color: rgb(255, 100, 33);
color: $toolbarBtnHoverColor;
}
}
.cherry-toc-list {
Expand Down Expand Up @@ -332,7 +333,7 @@ $mdSvgTextColor: rgb(250, 160, 0);
}

a {
text-decoration: none;
text-decoration: underline;
color: $mdAColor;
&:hover {
color: $mdAHoverColor;
Expand Down Expand Up @@ -463,6 +464,7 @@ $mdSvgTextColor: rgb(250, 160, 0);
color: $mdColor;
&:hover {
color: $mdAHoverColor;
text-decoration: underline;
}
}
}
Expand Down
12 changes: 10 additions & 2 deletions src/sass/themes/default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@
}
}

// 更改编辑区域选中文字区域的背景色
// 覆盖了 codemirror.css 中的默认样式
.CodeMirror-focused .CodeMirror-selected { background: #bac8ff; }
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #bac8ff; }
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #bac8ff; }


/** 光标focus到空行时联想出的按钮 */
.cherry-floatmenu {

background-color: #e9ecef;
}

.cherry-editor {
Expand Down Expand Up @@ -135,7 +141,9 @@
}

a {

&:hover {
text-decoration: underline;
}
}

strong {
Expand Down
4 changes: 2 additions & 2 deletions src/sass/variable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $editorBg: #f8fafb;
$previewBg: #f8fafb;
$fontColor: #3f4a56;
$linkColor: #3582fb;
$linkHoverColor: #056bad;
$linkHoverColor: #364fc7;
$borderColor: #dfe6ee;
$toolbarSplitColor: #dfe6ee;
$fullWidthColor: #d71616;
Expand Down Expand Up @@ -66,7 +66,7 @@ $editorKeywordColor: $fontColor;

// 工具栏
// 暗色
$toolbarBgDark: #20304b;
$toolbarBgDark: $linkHoverColor;
$toolbarShadowDark: $shadow;
$toolbarBtnBgDark: transparent;
$toolbarBtnColorDark: #d7e6fe;
Expand Down
Loading