summaryrefslogtreecommitdiffhomepage
path: root/themes/luci-theme-openwrt-2020/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-04-09 14:25:51 +0200
committerJo-Philipp Wich <jo@mein.io>2021-04-09 14:29:12 +0200
commitc5ff3244e92f267e3b7410b3196615f5fec75051 (patch)
treeb71e334baacca8dc8bfec653f4f99403ddda4822 /themes/luci-theme-openwrt-2020/luasrc
parent2155868175fdf1de273cafc0b37b1b9fd5900b04 (diff)
luci-theme-openwrt-2020: honor CSS definitions passed by views
Legacy Lua views might declare a global `css` variable to inject custom styles into the template header. Support this mechanism in the OpenWrt 2020 theme as well. Ref: https://github.com/openwrt/luci/issues/4972 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'themes/luci-theme-openwrt-2020/luasrc')
-rw-r--r--themes/luci-theme-openwrt-2020/luasrc/view/themes/openwrt2020/header.htm4
1 files changed, 4 insertions, 0 deletions
diff --git a/themes/luci-theme-openwrt-2020/luasrc/view/themes/openwrt2020/header.htm b/themes/luci-theme-openwrt-2020/luasrc/view/themes/openwrt2020/header.htm
index f6ae02c212..6370ee4d1f 100644
--- a/themes/luci-theme-openwrt-2020/luasrc/view/themes/openwrt2020/header.htm
+++ b/themes/luci-theme-openwrt-2020/luasrc/view/themes/openwrt2020/header.htm
@@ -28,6 +28,10 @@
<script type="text/javascript" src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
<title><%=striptags( (boardinfo.hostname or "?") .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
+<% if css then %><style title="text/css">
+<%= css %>
+</style>
+<% end -%>
</head>
<body class="lang_<%=luci.i18n.context.lang%>" data-page="<%= pcdata(path) %>">