chore: refactor css code style

This commit is contained in:
Dillon 2020-02-14 22:07:46 +08:00
parent 1088f86b6d
commit 73b1250cbf
26 changed files with 30 additions and 19 deletions

View file

@ -270,20 +270,6 @@
@import "../_partial/_single/code";
@import "../_partial/_single/admonition";
.mermaid {
width: 100%;
margin: 3% auto;
text-align: center;
@import "../_mermaid/neutral/index";
.dark-theme & {
@import "../_mermaid/dark/index";
}
}
@import "../_aplayer/dark.scss";
.echarts {
width: 100%;
height: 30rem;

View file

@ -4,3 +4,4 @@ gittalk@1.5.0
katex@0.11.1
aplayer@1.10.1
animate.css@3.7.2
mermaid@8.4.2

11
assets/css/mermaid.scss Normal file
View file

@ -0,0 +1,11 @@
.mermaid {
width: 100%;
margin: 3% auto;
text-align: center;
@import "lib/mermaid/neutral/index";
.dark-theme & {
@import "lib/mermaid/dark/index";
}
}

View file

@ -38,7 +38,7 @@
{{- end -}}
{{- /* Fork Awesome https://forkaweso.me/ */ -}}
{{- $options := dict "targetPath" "css/lib/forkawesome/forkawesome.min.css" "outputStyle" "compressed" "enableSourceMap" true -}}
{{- $options := dict "targetPath" "css/lib/forkawesome/fork-awesome.min.css" "outputStyle" "compressed" "enableSourceMap" true -}}
{{- $res := resources.Get "css/lib/forkawesome/fork-awesome.scss"| toCSS $options -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">

View file

@ -104,6 +104,7 @@
{{- else -}}
{{- slice "js/lib/mermaid/mermaid.min.js" | $.Scratch.Add "scriptLocal" -}}
{{- end -}}
{{- slice "css/mermaid.scss" | $.Scratch.Add "linkLocal" -}}
<script>
window.mermaidMap = {{ jsonify . | safeJS }};
</script>
@ -117,6 +118,7 @@
{{- else -}}
{{- slice "css/lib/aplayer/APlayer.min.css" | .Scratch.Add "linkLocal" -}}
{{- end -}}
{{- slice "css/lib/aplayer/dark.scss" | .Scratch.Add "linkLocal" -}}
{{- with $CDN.aplayer_js -}}
{{- slice . | $.Scratch.Add "scriptCDN" -}}
{{- else -}}
@ -176,7 +178,10 @@
{{- end -}}
{{- range .Scratch.Get "linkLocal" -}}
{{- $res := resources.Get . -}}
{{- if not (strings.HasSuffix . ".min.css") -}}
{{- if strings.HasSuffix . ".scss" -}}
{{- $options := dict "outputStyle" "compressed" "enableSourceMap" true -}}
{{- $res = toCSS $options $res -}}
{{- else if not (strings.HasSuffix . ".min.css") -}}
{{- $res = minify $res -}}
{{- end -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">

View file

@ -0,0 +1,3 @@
.dark-theme .aplayer{background:#212121}.dark-theme .aplayer.aplayer-withlist .aplayer-info{border-bottom-color:#5c5c5c}.dark-theme .aplayer.aplayer-fixed .aplayer-list{border-color:#5c5c5c}.dark-theme .aplayer .aplayer-body{background-color:#212121}.dark-theme .aplayer .aplayer-info{border-top-color:#212121}.dark-theme .aplayer .aplayer-info .aplayer-music .aplayer-title{color:#fff}.dark-theme .aplayer .aplayer-info .aplayer-music .aplayer-author{color:#fff}.dark-theme .aplayer .aplayer-info .aplayer-controller .aplayer-time{color:#eee}.dark-theme .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon path{fill:#eee}.dark-theme .aplayer .aplayer-list{background-color:#212121}.dark-theme .aplayer .aplayer-list::-webkit-scrollbar-thumb{background-color:#999}.dark-theme .aplayer .aplayer-list::-webkit-scrollbar-thumb:hover{background-color:#bbb}.dark-theme .aplayer .aplayer-list li{color:#fff;border-top-color:#666}.dark-theme .aplayer .aplayer-list li:hover{background:#4e4e4e}.dark-theme .aplayer .aplayer-list li.aplayer-list-light{background:#6c6c6c}.dark-theme .aplayer .aplayer-list li .aplayer-list-index{color:#ddd}.dark-theme .aplayer .aplayer-list li .aplayer-list-author{color:#ddd}.dark-theme .aplayer .aplayer-lrc{text-shadow:-1px -1px 0 #666}.dark-theme .aplayer .aplayer-lrc:before{background:-moz-linear-gradient(top, #212121 0%, rgba(33,33,33,0) 100%);background:-webkit-linear-gradient(top, #212121 0%, rgba(33,33,33,0) 100%);background:linear-gradient(to bottom, #212121 0%, rgba(33,33,33,0) 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#212121', endColorstr='#00212121',GradientType=0 )}.dark-theme .aplayer .aplayer-lrc:after{background:-moz-linear-gradient(top, rgba(33,33,33,0) 0%, rgba(33,33,33,0.8) 100%);background:-webkit-linear-gradient(top, rgba(33,33,33,0) 0%, rgba(33,33,33,0.8) 100%);background:linear-gradient(to bottom, rgba(33,33,33,0) 0%, rgba(33,33,33,0.8) 100%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#00212121', endColorstr='#cc212121',GradientType=0 )}.dark-theme .aplayer .aplayer-lrc p{color:#fff}.dark-theme .aplayer .aplayer-miniswitcher{background:#484848}.dark-theme .aplayer .aplayer-miniswitcher .aplayer-icon path{fill:#eee}
/*# sourceMappingURL=dark.css.map */

View file

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

View file

@ -0,0 +1 @@
{"Target":"css/lib/forkawesome/fork-awesome.min.css","MediaType":"text/css","Data":{}}

View file

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

File diff suppressed because one or more lines are too long

View file

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