想给Hexo-Theme-LX增加深色模式 你可来对地方了

操作有风险 修改需谨慎

请在修改前做好备份!!!

究极简单方案 (顺手送一个自动更新)

1.修改theme/lx/_config.yml 将最后面的 css: //cdn.jsdelivr.net/npm/[email protected]/source/css/ 修改为css: https://cdn.jsdelivr.net/gh/186526/hexo-theme-lx/source/css/

2.修改theme/lx/_config.yml 将Comment中的 cdn: //cdn.bootcss.com/valine/1.3.10/Valine.min.js 修改为cdn: https://cdn.jsdelivr.net/gh/186526/hexo-theme-lx/source/js/Valine.min.js

PS:我不保证你的博客的速度 doge

PSPS:现已将js和css移动至cdn.jsdevivr.net

PSPSPS:现已修复无法使用冒号

普通方法 (不包括Valine评论)

1.修改theme/lx/_config.yml 将最后面的 css: //cdn.jsdelivr.net/npm/[email protected]/source/css/ 修改为css: /css/

2.在theme/lx/source/css/main.min.css里添加下列代码

@media (prefers-color-scheme:dark){:root{--background-color:#111;--page-background:#212121;--text-color:#ededed;--color-alpha:#50a8d8}.lx-post{padding:10px;background-color:#111}body{margin:0;background:#111;color:#ededed;font-weight:400;font-size:16px;line-height:1.7}.lx-post .lx-entry{float:left;margin-bottom:15px;width:100%;border:none;border-radius:15px;background:#222;box-shadow:0 .5em 1em -.125em hsla(0,0%,4%,.1),0 0 0 1px hsla(0,0%,4%,.02);border:1px solid #222}.lx-post .lx-entry>div p:last-child{margin-bottom:0;color:#ccc}h2.title{padding-left:8px;border-left:4px solid #b70038;color:#ccc}figure,h1,h2,h3,h4,h5{margin-top:15px;margin-bottom:5px;color:#ccc;font-weight:400}footer{clear:both;padding:20px 60px;font-size:12px;color:#ccc}.lx-post-detail{display:block;margin-bottom:10px;padding-left:10px;border-left:4px solid rgba(247,65,65,.761);color:hsla(0,0%,100%,.5);text-transform:uppercase;letter-spacing:.05em;font-weight:100}.menu .has-sub ul li a{display:block;padding:12px 33px;border-bottom:0;border-bottom:1px dotted #e1e1e1;color:#ccc;background-color:#333;font-size:13px;transition:.1s}h2.title a{color:#ccc}.single .lx-post .lx-entry{border:1px solid #222;box-shadow:none}.lx-entry img,.single .lx-post img{box-sizing:border-box;margin:0 auto 20px;padding:3px;height:auto;max-width:100%;border:none}.v *{background:#222}.v .vwrap .vcard .vimg{border:1px solid #222}.v .vsys{background:#555;color:#eee}.v .vlist,.v .vwrap{border:1px solid #222;border-radius:4px;background:#222}code {overflow-wrap: break-word;word-wrap: break-word;padding: 2px 4px;color: #c7254e;background: #eee;border-radius: 3px;font-size: 14px}}

3.三件套一部到位

1.实现方法:

2.优势:

3.缺点: