1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add support for colouring tab icon in settings.js

```
editorTheme: {
    page: {
       tabicon: {
           icon: "full/path/of/tabicon.svg",
           colour: "#008f00"
    }
}
```

The old way still works also (but doesn't allow the tabicon to
be coloured:
```
editorTheme: {
    page: {
       tabicon: "full/path/of/tabicon.svg"
    }
}
```
This commit is contained in:
Casey Wilkes 2021-09-10 13:10:01 +12:00
parent abaebb329d
commit a3d2f6592e
2 changed files with 11 additions and 4 deletions

View File

@ -24,7 +24,10 @@ var defaultContext = {
page: { page: {
title: "Node-RED", title: "Node-RED",
favicon: "favicon.ico", favicon: "favicon.ico",
tabicon: "red/images/node-red-icon-black.svg" tabicon: {
icon: "red/images/node-red-icon-black.svg",
colour: "#8f0000"
}
}, },
header: { header: {
title: "Node-RED", title: "Node-RED",
@ -123,9 +126,13 @@ module.exports = {
} }
if (theme.page.tabicon) { if (theme.page.tabicon) {
url = serveFile(themeApp,"/tabicon/",theme.page.tabicon) let icon = theme.page.tabicon.icon || theme.page.tabicon
url = serveFile(themeApp,"/tabicon/", icon)
if (url) { if (url) {
themeContext.page.tabicon = url; themeContext.page.tabicon.icon = url;
}
if (theme.page.tabicon.colour) {
themeContext.page.tabicon.colour = theme.page.tabicon.colour
} }
} }

View File

@ -23,7 +23,7 @@
--> -->
<title>{{ page.title }}</title> <title>{{ page.title }}</title>
<link rel="icon" type="image/png" href="{{ page.favicon }}"> <link rel="icon" type="image/png" href="{{ page.favicon }}">
<link rel="mask-icon" href="{{ page.tabicon }}" color="#8f0000"> <link rel="mask-icon" href="{{ page.tabicon.icon }}" color="{{ page.tabicon.colour }}">
<link rel="stylesheet" href="vendor/jquery/css/base/jquery-ui.min.css"> <link rel="stylesheet" href="vendor/jquery/css/base/jquery-ui.min.css">
<link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="red/style.min.css"> <link rel="stylesheet" href="red/style.min.css">