MrWillCom/hexo-theme-cupertino

Add current color scheme property to root element

Closed this issue · 7 comments

还有一个问题
image
对于我们的主题,我应该怎么配置呢

Originally posted by @jonie-ritie in #16 (comment)

试试这个?

'html[data-color-scheme="dark"]'

试试这个?

'html[data-color-scheme="dark"]'

当这个属性值是 "auto" 的时候还需要另外查询浏览器的 color scheme,所以恐怕不行。

另外,#16 (comment)

试试这个?

'html[data-color-scheme="dark"]'

当这个属性值是 "auto" 的时候还需要另外查询浏览器的 color scheme,所以恐怕不行。

另外,#16 (comment)

那主题改一下,如果在主题配置文档中选择auto,那么先查阅浏览器color scheme,如果是暗色,就修改 body 为 data-color-scheme="dark",和fluid一样;对于双引号单引号的问题,我觉得可以随机应变试一下,直接把引号去掉,我之前用过fluid,也有这个问题

另外,楼主你应该是初中生吧,前段时间不维护了是在准备中考吗?

7f4ae14<body /> 元素添加了 data-current-color-scheme 属性,值为 light / dark

另外,楼主你应该是初中生吧,前段时间不维护了是在准备中考吗?

对的,前几天刚刚考完。。。

现在可以用 'body[data-current-color-scheme="dark"]' 选择器了