添加自定义字体设置(正常、粗体)

Signed-off-by: sbwml <admin@cooluc.com>
This commit is contained in:
sbwml 2025-03-16 14:34:47 +08:00
parent ba2ec536d4
commit 9a4cc4f94c
5 changed files with 34 additions and 6 deletions

View File

@ -83,6 +83,12 @@ return view.extend({
o.default = 'normal';
o.rmempty = false;
o = s.option(form.ListValue, 'font_weight', _('Font'));
o.value('normal', _('Normal'));
o.value('600', _('Bold'));
o.default = '600';
o.rmempty = false;
o = s.option(form.Value, 'primary', _('[Light mode] Primary Color'), _('A HEX color (default: #5e72e4).'))
o.default = '#5e72e4';
o.rmempty = false;

View File

@ -199,3 +199,15 @@ msgstr "[亮色模式] 进度条字体颜色"
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:160
msgid "A HEX color (default: #2e2b60)."
msgstr "十六进制颜色值(预设为:#2e2b60。"
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:86
msgid "Font"
msgstr "字体"
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:87
msgid "Normal"
msgstr "正常"
#: applications/luci-app-argon-config/htdocs/luci-static/resources/view/argon-config.js:88
msgid "Bold"
msgstr "粗体"

View File

@ -2,6 +2,7 @@ config global
option primary '#5e72e4'
option dark_primary '#483d8b'
option progressbar_font '#2e2b60'
option font_weight '600'
option blur '10'
option blur_dark '10'
option transparency '0.2'

View File

@ -1046,8 +1046,8 @@ div[style="width:100%;height:300px;border:1px solid #000;background:#fff"] {
.main .main-left .nav li a {
display: block;
color: #69758c;
font-weight: bolder
color: var(--main-left-font-color);
font-weight: var(--font-weight)
}
.main .main-left .nav li.slide {
@ -1395,7 +1395,7 @@ h5 {
[data-page^="admin-system-admin"]:not(.node-main-login) .cbi-map:not(#cbi-dropbear),
[data-page="admin-system-opkg"] #maincontent>.container {
font-family: -apple-system,BlinkMacSystemFont,PingFang SC,Segoe UI,Microsoft YaHei,wenquanyi micro hei,Hiragino Sans GB,Hiragino Sans GB W3,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,Helvetica,Arial,sans-serif;
font-weight: 600;
font-weight: var(--font-weight);
font-style: normal;
line-height: normal;
min-width: inherit;
@ -1422,7 +1422,7 @@ h5 {
.cbi-map-descr,
.cbi-section-descr {
font-size: small;
font-weight: bolder;
font-weight: var(--font-weight);
line-height: 1.42857143;
padding: 0.5rem 1.5rem;
}
@ -1855,7 +1855,7 @@ td>table>tbody>tr>td,
text-decoration: none;
color: #5e6795;
padding: .5rem .8rem;
font-weight: bold
font-weight: var(--font-weight)
}
.tabs li:hover {
@ -4648,7 +4648,7 @@ div#service_status {
/* 接口名字 */
.cbi-section.cbi-tblsection strong {
font-weight: bold;
font-weight: var(--font-weight);
}
/* passwall faq */

View File

@ -38,12 +38,14 @@
-- Custom settings
local mode = 'normal'
local font_weight = '600'
local dark_css = fs.readfile('/www/luci-static/argon/css/dark.css')
local bar_color = '#5e72e4'
local primary, dark_primary, blur_radius, blur_radius_dark, blur_opacity
if fs.access('/etc/config/argon') then
primary = uci:get_first('argon', 'global', 'primary')
dark_primary = uci:get_first('argon', 'global', 'dark_primary')
font_weight = uci:get_first('argon', 'global', 'font_weight')
blur_radius = uci:get_first('argon', 'global', 'blur')
blur_radius_dark = uci:get_first('argon', 'global', 'blur_dark')
blur_opacity = uci:get_first('argon', 'global', 'transparency')
@ -54,6 +56,11 @@
if not progressbar_font then
progressbar_font = "#2e2b60"
end
if font_weight == "normal" then
main_left_font_color = "#5f6368"
else
main_left_font_color = "#69758c"
end
end
-- Brand name
@ -116,11 +123,13 @@
:root {
--primary: <%=primary%>;
--dark-primary: <%=dark_primary%>;
--font-weight: <%=font_weight%>;
--progressbar-font-color: <%=progressbar_font%>;
--blur-radius:<%=blur_radius%>px;
--blur-opacity:<%=blur_opacity%>;
--blur-radius-dark:<%=blur_radius_dark%>px;
--blur-opacity-dark:<%=blur_opacity_dark%>;
--main-left-font-color:<%=main_left_font_color%>;
}
<% end -%>
</style>