Merge pull request #150 from dillonzq/fix/dark_mode

fix(style): dark mode for mermaid and valine
This commit is contained in:
Dillon 2020-03-14 20:36:14 +08:00 committed by GitHub
commit b82c990d9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 49 additions and 100 deletions

View file

@ -250,31 +250,10 @@
} }
@import "../_partial/_single/code"; @import "../_partial/_single/code";
@import "../_partial/_single/instagram";
@import "../_partial/_single/admonition"; @import "../_partial/_single/admonition";
@import "../_partial/_single/echarts";
.echarts { @import "../_partial/_single/bilibili";
width: 100%;
height: 30rem;
margin: 3% auto;
text-align: center;
}
.bilibili {
position: relative;
width: 100%;
height: 0;
padding-bottom: 75%;
margin: 3% auto;
text-align: center;
iframe {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
}
hr { hr {
margin: 1rem 0; margin: 1rem 0;

View file

@ -0,0 +1,16 @@
.bilibili {
position: relative;
width: 100%;
height: 0;
padding-bottom: 75%;
margin: 3% auto;
text-align: center;
iframe {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
}

View file

@ -0,0 +1,6 @@
.echarts {
width: 100%;
height: 30rem;
margin: 3% auto;
text-align: center;
}

View file

@ -0,0 +1,5 @@
iframe.instagram-media {
.dark-theme & {
border: none !important;
}
}

View file

@ -10,6 +10,6 @@
@import "themes/neutral/index"; @import "themes/neutral/index";
.dark-theme & { .dark-theme & {
@import "themes/darker/index"; @import "themes/dark/index";
} }
} }

View file

@ -1,62 +0,0 @@
$mainBkg: #BDD5EA;
$secondBkg: #6D6D65;
$mainContrastColor: lightgrey;
$darkTextColor: #323D47;
$lineColor: $mainContrastColor;
$border1: #81B1DB;
$border2: rgba(255, 255, 255, 0.25);
$arrowheadColor: $mainContrastColor;
/* Flowchart variables */
$nodeBkg: $mainBkg;
$nodeBorder: purple;
$clusterBkg: $secondBkg;
$clusterBorder: $border2;
$defaultLinkColor: $lineColor;
$titleColor: #F9FFFE;
$edgeLabelBackground: #e8e8e8;
/* Sequence Diagram variables */
$actorBorder: $border1;
$actorBkg: $mainBkg;
$actorTextColor: black;
$actorLineColor: $mainContrastColor;
$signalColor: $mainContrastColor;
$signalTextColor: $mainContrastColor;
$labelBoxBkgColor: $actorBkg;
$labelBoxBorderColor: $actorBorder;
$labelTextColor: $darkTextColor;
$loopTextColor: $mainContrastColor;
$noteBorderColor: $border2;
$noteBkgColor: #fff5ad;
$activationBorderColor: #666;
$activationBkgColor: #f4f4f4;
$sequenceNumberColor: white;
/* Gantt chart variables */
$sectionBkgColor: rgba(255, 255, 255, 0.3);
$altSectionBkgColor: white;
$sectionBkgColor2: #EAE8B9;
$taskBorderColor: rgba(255, 255, 255, 0.5);
$taskBkgColor: $mainBkg;
$taskTextColor: $darkTextColor;
$taskTextLightColor: $mainContrastColor;
$taskTextOutsideColor: $taskTextLightColor;
$taskTextClickableColor: #003163;
$activeTaskBorderColor: rgba(255, 255, 255, 0.5);
$activeTaskBkgColor: #81B1DB;
$gridColor: $mainContrastColor;
$doneTaskBkgColor: $mainContrastColor;
$doneTaskBorderColor: grey;
$critBorderColor: #E83737;
$critBkgColor: #E83737;
$taskTextDarkColor: $darkTextColor;
$todayLineColor: #DB5757;
/* state colors */
$labelColor: black;
@import '../mermaid';

View file

@ -59,6 +59,7 @@
text { text {
font-family: 'trebuchet ms', verdana, arial; font-family: 'trebuchet ms', verdana, arial;
font-family: var(--mermaid-font-family); font-family: var(--mermaid-font-family);
fill: $taskTextOutsideColor;
} }
} }
@ -151,12 +152,12 @@
.taskTextOutside0, .taskTextOutside0,
.taskTextOutside2 .taskTextOutside2
{ {
fill: $taskTextOutsideColor; fill: $taskTextOutsideColor !important;
} }
.taskTextOutside1, .taskTextOutside1,
.taskTextOutside3 { .taskTextOutside3 {
fill: $taskTextOutsideColor; fill: $taskTextOutsideColor !important;
} }
@ -174,7 +175,7 @@
.activeText1, .activeText1,
.activeText2, .activeText2,
.activeText3 { .activeText3 {
fill: $taskTextDarkColor !important; fill: $taskTextDarkColor;
} }
@ -193,7 +194,7 @@
.doneText1, .doneText1,
.doneText2, .doneText2,
.doneText3 { .doneText3 {
fill: $taskTextDarkColor !important; fill: $taskTextDarkColor;
} }
@ -239,20 +240,20 @@
.doneCritText1, .doneCritText1,
.doneCritText2, .doneCritText2,
.doneCritText3 { .doneCritText3 {
fill: $taskTextDarkColor !important; fill: $taskTextDarkColor;
} }
.activeCritText0, .activeCritText0,
.activeCritText1, .activeCritText1,
.activeCritText2, .activeCritText2,
.activeCritText3 { .activeCritText3 {
fill: $taskTextDarkColor !important; fill: $taskTextDarkColor;
} }
.titleText { .titleText {
text-anchor: middle; text-anchor: middle;
font-size: 18px; font-size: 18px;
fill: $taskTextDarkColor; fill: $taskTextOutsideColor;
font-family: 'trebuchet ms', verdana, arial; font-family: 'trebuchet ms', verdana, arial;
font-family: var(--mermaid-font-family); font-family: var(--mermaid-font-family);
} }

View file

@ -25,6 +25,10 @@
.v code, .v pre { .v code, .v pre {
background: #272C34; background: #272C34;
} }
.v .vmark .vinput {
color: #0e0f10;
}
} }
.v code, .v pre { .v code, .v pre {

View file

@ -51,7 +51,7 @@
{{- if .Site.Params.comment.valine.enable -}} {{- if .Site.Params.comment.valine.enable -}}
{{- $valine := .Site.Params.comment.valine -}} {{- $valine := .Site.Params.comment.valine -}}
<div id="valine"></div> <div id="valine"></div>
{{- slice "lib/valine/dark.scss" | $scratch.Add "linkLocal" -}} {{- slice "lib/valine/valine.scss" | $scratch.Add "linkLocal" -}}
{{- with $CDN.valineJS -}} {{- with $CDN.valineJS -}}
{{- slice . | $scratch.Add "scriptCDN" -}} {{- slice . | $scratch.Add "scriptCDN" -}}
{{- else -}} {{- else -}}

View file

@ -1 +0,0 @@
{"Target":"lib/valine/dark.css","MediaType":"text/css","Data":{}}

View file

@ -1,3 +1,3 @@
.dark-theme .v *,.dark-theme .v .vwrap input,.dark-theme .v .vwrap input::placeholder,.dark-theme .v .veditor,.dark-theme .v .veditor::placeholder,.dark-theme .v a,.dark-theme .v a:hover{color:rgba(255,255,255,0.75);opacity:1}.dark-theme .v .vbtn{color:rgba(255,255,255,0.75);background:#333;border:none}.dark-theme .v .vbtn:hover{color:#3090e4;border-color:#3090e4}.dark-theme .v .vlist .vcard .vhead .vsys{background:#333}.dark-theme .v code,.dark-theme .v pre{background:#272C34}.v code,.v pre{text-align:left} .dark-theme .v *,.dark-theme .v .vwrap input,.dark-theme .v .vwrap input::placeholder,.dark-theme .v .veditor,.dark-theme .v .veditor::placeholder,.dark-theme .v a,.dark-theme .v a:hover{color:rgba(255,255,255,0.75);opacity:1}.dark-theme .v .vbtn{color:rgba(255,255,255,0.75);background:#333;border:none}.dark-theme .v .vbtn:hover{color:#3090e4;border-color:#3090e4}.dark-theme .v .vlist .vcard .vhead .vsys{background:#333}.dark-theme .v code,.dark-theme .v pre{background:#272C34}.dark-theme .v .vmark .vinput{color:#0e0f10}.v code,.v pre{text-align:left}
/*# sourceMappingURL=dark.css.map */ /*# sourceMappingURL=valine.css.map */

View file

@ -0,0 +1 @@
{"Target":"lib/valine/valine.css","MediaType":"text/css","Data":{}}