luci-mod-dashboard: partially invert the black SVG in dark mode
authorPaul Donald <newtwen+github@gmail.com>
Sat, 30 Nov 2024 22:46:07 +0000 (23:46 +0100)
committerPaul Donald <newtwen+github@gmail.com>
Sat, 30 Nov 2024 22:48:13 +0000 (23:48 +0100)
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/css/custom.css
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/20_lan.js
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js

index bf475aa01ecbee66aa959c3bbf1420fbf0adb7c3..594a90bb69c36a5b5dbbf91273c4b4a659ba3285 100644 (file)
        border-bottom: 1px solid var(--border-color-medium, rgba(0, 0, 0, 0.1));
 }
 
+[data-darkmode="true"] {
+       /* invert black SVG line drawings in dark mode */
+       .Dashboard .svgmonotone {
+               filter: invert(.5);
+       }
+}
+
 /**
  * Responsive
  **/
index 4cc671da52687532d4636298359a082f2128d23b..639d372e1e0865a331f900c4272aa2ad70d61c7d 100644 (file)
@@ -44,7 +44,7 @@ return baseclass.extend({
                                'src': L.resource('view/dashboard/icons/' + icon + '.svg'),
                                'width': 'router' == type ? 64 : 54,
                                'title': title,
-                               'class': 'middle'
+                               'class': (type == 'router' || icon == 'not-internet') ? 'middle svgmonotone' : 'middle'
                        }),
                        E('h3', title)
                ]));
@@ -320,7 +320,7 @@ return baseclass.extend({
 
                        release: {
                                title: _('Firmware Version'),
-                               value: boardinfo.release.description
+                               value: boardinfo?.release?.description
                        }
                };
 
index 9f4edce288a8ad681440aa2f51088fb6c0af6fbb..27ecc0f7bff905aa023c43e1046cf1c0b9f72c75 100644 (file)
@@ -40,7 +40,7 @@ return baseclass.extend({
                                'src': L.resource('view/dashboard/icons/devices.svg'),
                                'width': 55,
                                'title': this.title,
-                               'class': 'middle'
+                               'class': 'middle svgmonotone'
                        }),
                        E('h3', this.title)
                ]));
index f87131ceac626baba95427849df29cfe9f8c11ba..2872c6a3e89932666610d7c25f48c5757f4dcbed 100644 (file)
@@ -41,7 +41,7 @@ return baseclass.extend({
                                'src': L.resource('view/dashboard/icons/wireless.svg'),
                                'width': 55,
                                'title': this.title,
-                               'class': 'middle'
+                               'class': 'middle svgmonotone'
                        }),
                        E('h3', this.title)
                ]));