armin/font-awesome-bundle
最新稳定版本:1.0.0
Composer 安装命令:
composer require armin/font-awesome-bundle
包简介
Symfony bundle to provide Font Awesome svg icons as inline svg sprite.
README 文档
README
This bundle for Symfony Framework, allows you to add FontAwesome SVG icons, inline in your html.
It is released under MIT license.
Installation
To install this package, you can just use composer:
$ composer require armin/font-awesome-bundle
This will also require the fortawesome/font-awesome package.
Please make sure, you've registred the bundle correctly in your project's config/bundles.php.
There is no configuration to be made.
Features
- Embed FontAwesome svg icons in our html output
- Without need of any CSS or JavaScript include
- Usage of SVG sprites:
- When the same icon is used several times on the same page (e.g. arrow icons), every additional instance of this icon will point to the first occurence in html output
- Each instance can have individual options, like size or color
- This saves space, in html output
- No need to copy/symlink SVG assets from
vendor/topublic/
Usage
Once this bundle is installed, you can use the following Twig function:
{{ fa("smile-beam") }} == {{ fa("fas smile-beam") }}
{{ fa("far smile-beam") }}
{{ fa("far smile-beam", {size: 256, color: '#d50', class: 'card shadow'}) }}
It is recommended, to add some default CSS.
All icons in html output, will have got the class fa-svg-icon set:
.fa-svg-icon {
width: 32px;
height: 32px;
fill: #444;
}
When you provide options, like size or color, inline styles will overwrite the default CSS.
Support
If you like this Symfony bundle, you are invited to donate some funds to support further development. Thank you!
For help please visit the issue section on Github.
统计信息
- 总下载量: 314
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-29