The Icon FT parses SCSS/CSS files with regex to figure out what different icons are available.
Config Array
You need to add an icon set to the icons config array. Below is an example of the array you need to populate:
'fontawesome5' => [
'prefix' => 'fa fa-',
'name' => 'Font Awesome 5',
'regex' => '\.fa\-([a-z0-9-]+):before{',
'website' => 'https://fontawesome.com/v5.0/icons/',
'path' => 'namespace.addon_type.myAddon::scss/fontawesome5/icons.scss',
],
The file referenced in path
will be minified before being parsed. Take this into account when bilding your REGEX
Adding your config array to the field type
To add your icons config array to the icon configuration set use the config helper in the boot method of a service provider.
/**
* Boot the addon.
*/
public function boot()
{
config([
'anomaly.field_type.icon::icons.fontawesome5' => [
'prefix' => 'fa fa-',
'name' => 'Font Awesome 5',
'regex' => '\.fa\-([a-z0-9-]+):before{',
'website' => 'https://fontawesome.com/v5.0/icons/',
'path' => 'namespace.addon_type.my_addon::css/fontawesome5/icons.scss',
]
]);
}
Note: The key you use in your config array is what you put at the end of the configuration declaration. The above examples use the key fontawesome5
.