Skip to content

Instantly share code, notes, and snippets.

@prantlf
Created January 15, 2021 19:00
Show Gist options
  • Save prantlf/7e82dd257db9bee10ee108134dd3a97e to your computer and use it in GitHub Desktop.
Save prantlf/7e82dd257db9bee10ee108134dd3a97e to your computer and use it in GitHub Desktop.
How to assign a custom icon to a specific subtype.
src/icons/images/mytype.svg:
The icon image content.
src/icons/icons.css:
.binf-widgets .myext-mytype {
background-image: url('images/mytype.svg');
}
src/icons/icons.js:
define([
'css!myext/icons/icons'
], function () {
return [
{
equals: { type: 12345 }
}
];
});
src/myext-extensions.json:
{
"csui/utils/nodesprites": {
"extensions": {
"myext": [
"myext/icons/icons"
]
}
},
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment