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

【建议】新增一个配置 auto-colorscheme #164

Closed
jerryc127 opened this issue Mar 7, 2021 · 2 comments
Closed

【建议】新增一个配置 auto-colorscheme #164

jerryc127 opened this issue Mar 7, 2021 · 2 comments
Labels
discussion Question or dicussion

Comments

@jerryc127
Copy link
Contributor

建议在前端配置新增一个配置 auto-colorscheme(随系统状态切换light dark mode)

如果设为true 的话

就加载这段css
https://github.com/lizheming/waline/blob/209e86c3f95b3a5d0c7988498419a87044bf4878/packages/client/src/index.css#L718

@media (prefers-color-scheme:dark) {
	.v[data-class=v] .status-bar,
	.v[data-class=v] .veditor,
	.v[data-class=v] .vinput,
	.v[data-class=v] p,
	.v[data-class=v] pre code {
		color: #b2b2b5
	}
	.v[data-class=v] .vsys,
	.v[data-class=v] .vtime {
		color: #929298
	}
	.v[data-class=v] code,
	.v[data-class=v] pre,
	.v[data-class=v] pre code {
		color: #929298;
		background-color: #151414
	}
	.v[data-class=v] .vwrap {
		border-color: #b2b2b5
	}
	.v[data-class=v] .vicon {
		fill: #b2b2b5
	}
	.v[data-class=v] .vicon.actived {
		fill: #66b1ff
	}
	.v[data-class=v] .vbtn {
		color: #b2b2b5;
		border-color: #b2b2b5
	}
	.v[data-class=v] .vbtn:hover {
		color: #66b1ff;
		border-color: #66b1ff
	}
	.v[data-class=v] a:hover {
		color: #d7191a
	}
	.v[data-class=v] .vcards .vcard .vcontent.expand:before {
		background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, .3)), to(rgba(0, 0, 0, .7)));
		background: linear-gradient(180deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, .7))
	}
	.v[data-class=v] .vcards .vcard .vcontent.expand:after {
		background: rgba(0, 0, 0, .7)
	}
}

这样可以避免主题不是夜间模式下,由于系统是夜间模式而导致评论部分ui 看不清的情况

(本想写了推送给你,但我看不懂react的逻辑)

@jerryc127
Copy link
Contributor Author

#110

@lizheming
Copy link
Collaborator

lizheming commented Mar 8, 2021

@waline/client@0.14.8 暂时去除了自适应相关的配置,如果需要适配可以在主题 <body> 添加 class .dark

@Mister-Hope Mister-Hope added the discussion Question or dicussion label Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Question or dicussion
Projects
None yet
Development

No branches or pull requests

3 participants