yceruto/iconpack
最新稳定版本:v0.1.2
Composer 安装命令:
composer require yceruto/iconpack
包简介
Svg-Twig Icons Collection
README 文档
README
A simple way to include and customize icons in your Twig projects.
Installation
$ composer require yceruto/iconpack
Collections available:
Usage
Some Twig template:
{{ include('@Heroicons/solid/archive-box.svg.twig') }}
Output:
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" fill="white" aria-hidden="true" data-slot="icon" class="size-6"> <path d="M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z"></path> <path fill-rule="evenodd" d="m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.163 3.75A.75.75 0 0 1 10 12h4a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1-.75-.75Z" clip-rule="evenodd"></path> </svg>
Some SVG attributes can be modified using Twig parameters:
{{ include('@Heroicons/solid/archive-box.svg.twig', {'class': 'size-7'}) }}
Available parameters are:
fillSets the color to fill the inner areas of the SVG shape. Accepts any CSS color value.classAdds custom CSS classes to the SVG, allowing for additional styling, such as size or visibility adjustments.strokeSpecifies the color of the SVG outline or border, which can enhance or change the SVG’s edge visibility.stroke_widthDefines the width of the SVG outline, making the border thicker or thinner depending on the value.
Note that some icon templates don't include the
strokeandstroke_widthvariables as there are useless for some icons.
Contribution
Update templates files definition:
$ ./bin/update.sh
License
This software is published under the MIT License
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-11-12