generated from blade-ui-kit/blade-icons-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added auto update generation script (#4)
* added auto update generation script * fixes tests
- Loading branch information
1 parent
4b912fc
commit 0250721
Showing
311 changed files
with
384 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bdcfcda5700b931b436dd665df7f3ed544da3a96 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
REPOSITORY=dovy/elusive-icons | ||
BRANCH=master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ composer.lock | |
phpunit.xml | ||
.php-cs-fixer.cache | ||
package-lock.json | ||
.php_cs.cache | ||
dist/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,77 @@ | ||
<?php | ||
|
||
use Codeat3\BladeIconGeneration\IconProcessor; | ||
|
||
$svgNormalization = static function (string $tempFilepath, array $iconSet) { | ||
|
||
$attrsToRemove = [ | ||
'sodipodi:docname', | ||
'version', | ||
'docname', | ||
'enable-background', | ||
'x', | ||
'y' | ||
]; | ||
$nsAttrsToRemove = [ | ||
'dc' => 'http://purl.org/dc/elements/1.1/', | ||
'cc' => 'http://creativecommons.org/ns#', | ||
'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', | ||
'svg' => 'http://www.w3.org/2000/svg', | ||
'sodipodi' => 'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd', | ||
'inkscape' => 'http://www.inkscape.org/namespaces/inkscape', | ||
'xlink' => 'http://www.w3.org/1999/xlink', | ||
'version' => '0.48.4 r9939' | ||
]; | ||
|
||
// perform generic optimizations | ||
$iconProcessor = new IconProcessor($tempFilepath, $iconSet); | ||
$iconProcessor | ||
->optimize(pre: function (&$svgEl) use ($attrsToRemove, $nsAttrsToRemove) { | ||
foreach ($svgEl->attributes as $att) { // get the attributes | ||
if (in_array($att->nodeName, $attrsToRemove)) { | ||
$svgEl->removeAttributeNode($att); //remove the attribute | ||
$svgEl->removeAttribute($att->nodeName); //remove the attribute | ||
} | ||
} | ||
|
||
foreach ($nsAttrsToRemove as $nk => $nv) { | ||
$svgEl->removeAttributeNS($nv, $nk); | ||
} | ||
|
||
|
||
$namedview = $svgEl->getElementsByTagName('namedview'); | ||
if ($namedview && $namedview[0]) { | ||
$svgEl->removeChild($namedview[0]); | ||
} | ||
|
||
|
||
}) | ||
->postOptimizationAsString(function ($svgLine) { | ||
$svgLine = str_replace('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', '', $svgLine); | ||
return $svgLine; | ||
// $replacePattern = [ | ||
// '/<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">/s' => '', | ||
// ]; | ||
// return preg_replace(array_keys($replacePattern), array_values($replacePattern), $svgLine); | ||
}) | ||
->save(); | ||
}; | ||
|
||
return [ | ||
[ | ||
'source' => null, | ||
'destination' => __DIR__.'/../resources/svg', | ||
// Define a source directory for the sets like a node_modules/ or vendor/ directory... | ||
'source' => __DIR__ . '/../dist/dev/icons-svg', | ||
|
||
// Define a destination directory for your icons. The below is a good default... | ||
'destination' => __DIR__ . '/../resources/svg', | ||
|
||
// Enable "safe" mode which will prevent deletion of old icons... | ||
'safe' => false, | ||
|
||
// Call an optional callback to manipulate the icon | ||
// with the pathname of the icon and the settings from above... | ||
'after' => $svgNormalization, | ||
|
||
'is-solid' => true, | ||
], | ||
]; |
Submodule dist
added at
5ddd91
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.