Download the PHP package codeat3/blade-icon-generation-helpers without Composer
On this page you can find all versions of the php package codeat3/blade-icon-generation-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package blade-icon-generation-helpers
Blade Icon Generation Helpers
A helper package to convert the icons to make it compatible to be used with the blade-icons
package.
Installation
Usage
Kindly refer the Generating Icons section from Blade Icons. This Package utilizes the after
callback to process the icons as per our need.
The after
callback received 3 arguments string $icon
- this is the pathname of the icon, array $config
- the config specified in the generation.php
& SplFileInfo $file
- the original icon file instance.
Inside a callback we instantiate our Processor class & use its helper methods to our benefit.
This IconProcessor
instance itself does some optimization on its own by default. Minimal usage would be as follows.
The optimize
method does the following things by default:
- it removes the following attributes from the svg
- 'width', 'height', 'class', 'style', 'id',
- if in the config provided
is-outline
is set astrue
- if
fill
attribute exists - it will updated tonone
- if
stroke
attribute exists - it will updated tocurrentColor
- if
- if in the config provided
is-solid
is set astrue
- if
fill
attribute exists - it will updated tocurrentColor
- if
- if in the config provided
custom-attributes
is set`- it will set the attributes to the svg
- optionally it provides 2 callable methods
pre
&post
- both callback receives the
$svgEL
as theDOMDocument
- its the DOMDocument instance of the current icon pre
can be used if you have to perform some operation before Processor does the default processingpost
can be used if you have to perform some operation after Processor does the default processing
- both callback receives the
The save
method
All versions of blade-icon-generation-helpers with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
codeat3/laravel-page-speed Version 2.3
symfony/process Version ^5.0|^6.0|^7.0
symfony/filesystem Version ^5.0|^6.0|^7.0
codeat3/inlinestyle Version ^2.1