kunoichi / icon
A icon toolset for WordPress
Installs: 3 548
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 2
Language:JavaScript
Requires
- php: >=5.6
- hametuha/singleton-pattern: ^1.2
- kunoichi/bootstrapress: ^1.0.2
- yoast/phpunit-polyfills: ^1.0
Requires (Dev)
- phpunit/phpunit: >=5.7
- squizlabs/php_codesniffer: ^3.0
- wp-coding-standards/wpcs: ^2.0
This package is auto-updated.
Last update: 2024-10-25 09:56:34 UTC
README
An icon communicator for WordPress. You can include Icon Block and Inline Icon in your block editor.
Supported Icons
- Dashicons
- Font Awesome 5
You can add your original icons.
Core Concept
This library will parse and grab the icon names from your web font CSS. If you like to choose your iconsets(e.g. for performance), customize your web-font CSS.
Installation
Use composer.
composer require kunoich/icon
From your theme or plugin's boostrap file, include autoloader.php
.
require __DIR__ . '/vendor/autoload.php';
Then enable icon blocks.
Kunoichi\Icon\Manager::register();
Customize
Create Your Own
Each font are parsed by a class which inherits Kunoichi\Icon\Pattern\IconSet
.
You have to parse CSS by your self. For details, see Kunoichi\Icon\Iconsets\Dashicons
and do what it does.
Before Manager::register
, just make new instance of your class.
new YourIconSets( 'path/to/your/icon.css' ); Kunoichi\Icon\Manager::register();
For Font Awesome 5 Pro, see Kunoichi\Icon\Iconsets\FontAwesomeSolid
for your information.
It parses SVG :)
Remove Defaults
If you don't use some of default icons(e.g. dashicons), pass argument for exclude list.
Kunoichi\Icon\Manager::register( [ 'dashicons' => false ] );
Thus, no dashicons will be listed.
License
GPL 3.0 or later. Font Awesome is under Font Awesome Free License.