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

header.htm主题颜色模式判断option mode 'light' 失效,改为1.8.3版本的判断方式就可以了 #521

Open
OpenFi-One opened this issue Aug 26, 2024 · 3 comments

Comments

@OpenFi-One
Copy link

目前2.3.1的header.htm判断 option mode 'light' 是不行的,设置了后还是跟着系统的暗黑模式。
直接用原来的1.8.3版本的写法替换进去就可以了

<style title="text/css">
<% if mode ~= 'dark' then %>
@media (prefers-color-scheme: dark) {
<%=dark_css%>
}
<% if fs.access('/etc/config/argon') then %>
:root {
--primary: <%=primary%>;
--dark-primary: <%=dark_primary%>;
--bar-bg: <%=primary%>;
--blur-radius:<%=blur_radius%>px;
--blur-opacity:<%=blur_opacity%>;
--blur-radius-dark:<%=blur_radius_dark%>px;
--blur-opacity-dark:<%=blur_opacity_dark%>;
}
<% end -%>
<% elseif mode == 'dark' then %>
<%=dark_css%>
<% if fs.access('/etc/config/argon') then %>
:root {
--primary: <%=primary%>;
--dark-primary: <%=dark_primary%>;
--bar-bg: <%=dark_primary%>;
--blur-radius:<%=blur_radius%>px;
--blur-opacity:<%=blur_opacity%>;
--blur-radius-dark:<%=blur_radius_dark%>px;
--blur-opacity-dark:<%=blur_opacity_dark%>;
}
<% end -%>
<% end -%>
</style>

用回1.8.3版本header.htm的判断后,就可以直接判断正确

<style title="text/css">
<% if mode == 'normal' then %>
@media (prefers-color-scheme: dark) {
<%=dark_css%>
}
<% elseif mode == 'dark' then %>
<%=dark_css%>
<% end -%>
<% if fs.access('/etc/config/argon') then %>
:root {
--primary: <%=primary%>;
--dark-primary: <%=dark_primary%>;
--blur-radius:<%=blur_radius%>px;
--blur-opacity:<%=blur_opacity%>;
--blur-radius-dark:<%=blur_radius_dark%>px;
--blur-opacity-dark:<%=blur_opacity_dark%>;
}
<% end -%>

.advanced {
    background-color: #ffffff;
    line-height: 30px;
    box-shadow: 0 0 2px #ccc;
    margin-top: 10px;
    margin-bottom: 10px;
}

</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@OpenFi-One and others