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

Make tab icon themeable

This commit is contained in:
Mauricio Bonani 2022-04-03 18:09:08 -04:00
parent 96d15b7505
commit e97f4c4054
3 changed files with 20 additions and 11 deletions

View File

@ -670,7 +670,7 @@ RED.tabs = (function() {
}
var link = $("<a/>",{href:"#"+tab.id, class:"red-ui-tab-label"}).appendTo(li);
if (tab.icon) {
$('<img src="'+tab.icon+'" class="red-ui-tab-icon"/>').appendTo(link);
$('<i>',{class:"red-ui-tab-icon", style:"mask-image: url("+tab.icon+"); -webkit-mask-image: url("+tab.icon+");"}).appendTo(link);
} else if (tab.iconClass) {
$('<i>',{class:"red-ui-tab-icon "+tab.iconClass}).appendTo(link);
}

View File

@ -307,6 +307,8 @@ $icons-flow-color: #808080;
$spinner-color: #999;
$tab-icon-color: #dedede;
// Deprecated
$text-color-green: $text-color-success;
$info-text-code-color: $text-color-code;

View File

@ -342,21 +342,28 @@
}
img.red-ui-tab-icon {
margin-left: -8px;
margin-right: 3px;
margin-top: -2px;
opacity: 0.1;
width: 20px;
height: 20px;
vertical-align: middle;
}
i.red-ui-tab-icon {
opacity: 0.7;
width: 18px;
height: 20px;
&:not(.fa) {
display: inline-block;
margin-left: -8px;
margin-right: 3px;
margin-top: -2px;
opacity: 1;
width: 20px;
height: 20px;
vertical-align: middle;
-webkit-mask-size: contain;
mask-size: contain;
-webkit-mask-position: center;
mask-position: center;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
background-color: $tab-icon-color;
}
}
.red-ui-tabs-badges {
position: absolute;
top:0px;