kravcik/latte-font-awesome-icon 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kravcik/latte-font-awesome-icon

最新稳定版本:v1.0.1

Composer 安装命令:

composer require kravcik/latte-font-awesome-icon

包简介

Simple {icon} macro for Latte, which allow short entry of font-awesome icons.

README 文档

README

New font awesome icons - latte generator. Replace older https://github.com/kravcik/nette-macro-fontawesome.

Register Extension

latte:
	extensions: 
		- Kravcik\LatteFontAwesomeIcon\Extension

You can also set default values, it is quite simple:

latte:
	extensions: 
		- Kravcik\LatteFontAwesomeIcon\Extension(defaultStyle: far, defaultFixedWidth: false, defaultElement: i)

Extension parameters

  1. defaultStyle - choose FA style (fas|far|fal|fab etc.), default is fal
  2. defaultFixedWidth - auto adding fa-fw to icons, defaults is true
  3. defaultElement - HTML element to generate icon, default is span

Macro parameters

Parameters can be named or ordered by numeral indexes (see examples)

  1. color - color for current icon, generate text-primary for bootstrap colors, for others go color-xxx
  2. size - size for current icon, for numeric generate fa-2x, for strings fa-lg
  3. fw - fixed width fa-fw for current icon
  4. element - custom HTML element for current icon
  5. style - style for current icon (fas|far|fal|fab etc.)
  6. class - custom class add for current HTML element

Examples

Examples depends on default values, so we using default setting (fal, fw, span).

{icon star} -> <span class="fal fa-star fa-fw"></i>

{icon star, primary} -> <span class="fal fa-star text-primary fa-fw"></span>

{icon star, red} -> <span class="fal fa-star color-red fa-fw"></span>

{icon star, null, lg} -> <span class="fal fa-star fa-lg fa-fw"></span>

{icon star, yellow, 2} -> <span class="fal fa-star color-yellow fa-2x fa-fw"></span>

{icon star, blue, size: 2, style: far} -> <span class="fal fa-star color-blue fa-2x"></span>

{icon star, class: foo, color: green} -> <span class="fal fa-star color-green foo"></span>

Package PHP Latte Font Awesome Bootstrap
v1 >=8.1 >=3 >5 5

统计信息

  • 总下载量: 10.64k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-17