定制 hofff/contao-iconfont 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

hofff/contao-iconfont

Composer 安装命令:

composer require hofff/contao-iconfont

包简介

Insert tag for Contao Open Source CMS to insert FontAwesome icons and individual icons

README 文档

README

Latest Version on Packagist Installations via composer per month Installations via composer total

Contao Extension: hofff.com - Iconfont

This extension provides some insert tags to insert FontAwesome and individual icons.

Features

insert all FontAwesome icons

Basic Use

see https://fontawesome.com/how-to-use/on-the-web/referencing-icons/basic-use

{{icon-fa*::icon-name}} 1

<i class="fa* fa-icon-name" aria-hidden="true"></i>

Fixed Width Icons

see https://fontawesome.com/how-to-use/on-the-web/styling/fixed-width-icons

{{icon-fa*-fw::icon-name}} 1

<i class="fa* fa-icon-name fa-fw" aria-hidden="true"></i>

Bordered + Pulled Icons

see https://fontawesome.com/how-to-use/on-the-web/styling/bordered-pulled-icons

wrap text around an icon - left

{{icon-fa*-left::icon-name}} 1

<i class="fa* fa-icon-name fa-2x fa-pull-left" aria-hidden="true"></i>

wrap text around an icon - right

{{icon-fa*-right::icon-name}} 1

<i class="fa* fa-icon-name fa-2x fa-pull-right" aria-hidden="true"></i>

wrap text around an icon with border - left

{{icon-fa*-border-left::icon-name}} 1

<i class="fa* fa-icon-name fa-2x fa-pull-left fa-border" aria-hidden="true"></i>

wrap text around an icon with border - right

{{icon-fa*-border-right::icon-name}} 1

<i class="fa* fa-icon-name fa-2x fa-pull-right fa-border" aria-hidden="true"></i>

Animating Icons

see https://fontawesome.com/how-to-use/on-the-web/styling/animating-icons

rotate icon

{{icon-fa*-spin::icon-name}} 1

<i class="fa* fa-icon-name fa-spin" aria-hidden="true"></i>

pulse icon

{{icon-fa*-pulse::icon-name}} 1

<i class="fa* fa-icon-name fa-pulse" aria-hidden="true"></i>

Rotating Icons

see https://fontawesome.com/how-to-use/on-the-web/styling/rotating-icons

turn 90° clockwise

{{icon-fa*-rotate-90::icon-name}} 1

<i class="fa* fa-icon-name fa-rotate-90" aria-hidden="true"></i>

turn 180° clockwise

{{icon-fa*-rotate-180::icon-name}} 1

<i class="fa* fa-icon-name fa-rotate-180" aria-hidden="true"></i>

turn 270° clockwise

{{icon-fa*-rotate-270::icon-name}} 1

<i class="fa* fa-icon-name fa-rotate-270" aria-hidden="true"></i>

mirror icon horizontally

{{icon-fa*-flip-horizontal::icon-name}} 1

<i class="fa* fa-icon-name fa-flip-horizontal" aria-hidden="true"></i>

mirror icon vertically

{{icon-fa*-flip-vertical::icon-name}} 1

<i class="fa* fa-icon-name fa-flip-vertical" aria-hidden="true"></i>

mirror icon vertically and horizontally (requires 5.7.0 or greater)

{{icon-fa*-flip-both::icon-name}} 1

<i class="fa* fa-icon-name fa-flip-both" aria-hidden="true"></i>

Stacked Icons

see https://fontawesome.com/how-to-use/on-the-web/styling/stacking-icons

icon with square background

{{icon-fa*-square::icon-name}}

<span class="fa-stack">
	<i class="fas fa-square fa-stack-2x" aria-hidden="true"></i>
	<i class="fa* fa-icon-name fa-stack-1x fa-inverse" aria-hidden="true"></i>
</span>

icon with square background - only border

{{icon-fa*-square-border::icon-name}}

<span class="fa-stack">
	<i class="far fa-square fa-stack-2x" aria-hidden="true"></i>
	<i class="fa* fa-icon-name fa-stack-1x" aria-hidden="true"></i>
</span>

icon with circle background

{{icon-fa*-circle::icon-name}}

<span class="fa-stack">
	<i class="fas fa-circle fa-stack-2x" aria-hidden="true"></i>
	<i class="fa* fa-icon-name fa-stack-1x fa-inverse" aria-hidden="true"></i>
</span>

icon with circle background - only border

{{icon-fa*-circle-border::icon-name}}

<span class="fa-stack">
	<i class="far fa-circle fa-stack-2x" aria-hidden="true"></i>
	<i class="fa* fa-icon-name fa-stack-1x" aria-hidden="true"></i>
</span>

icon with prohibition sign

{{icon-fa-ban::icon-name}}

<span class="fa-stack">
	<i class="fa* fa-icon-name fa-stack-1x" aria-hidden="true"></i>
	<i class="fas fa-ban fa-stack-2x" aria-hidden="true"></i>
</span>

insert your own icon font (you have to provide some css by your own)

{{icon::your-icon-name}}

<i class="icon icon-your-icon-name" aria-hidden="true"></i>

CSS Example for your own icon font

/* Include your icon font files */

@font-face {
  font-family: "Your icon font name";
  src: url('your-icon-font-filename.eot') format('embedded-opentype'),
  url('your-icon-font-filename.ttf') format('truetype'),
  url('your-icon-font-filename.woff') format('woff'),
  url('your-icon-font-filename.woff2') format('woff2'),
  url('your-icon-font-filename.svg') format('svg');
}

/* base styles for .icon */

.icon {
  font-family: "Your icon font name";
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;

  /* Better Font Rendering =========== */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* replace individual icon */

.icon-your-icon-1 {
  &:before {
    content: "\XXXX";
  }
}

Installation

Install the extension via composer: hofff/contao-iconfont.

If you prefer to install it manually, download the latest release here: https://github.com/hofff/contao-iconfont/releases

Compatibility

  • min. Contao version: ^4.9
  • PHP min. 7.4 || 8.0

Dependency

Footnotes

  1. The * should be replaced with the FontAwesome-Style you want: fas=Solid, far=Regular, fal=Light or fab=Brands 2 3 4 5 6 7 8 9 10 11 12 13 14

hofff/contao-iconfont 适用场景与选型建议

hofff/contao-iconfont 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 875 次下载、GitHub Stars 达 2, 最近一次更新时间为 2016 年 12 月 01 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「FontAwesome」 「icon」 「contao」 「iconfont」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 hofff/contao-iconfont 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hofff/contao-iconfont 我们能提供哪些服务?
定制开发 / 二次开发

基于 hofff/contao-iconfont 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 875
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 24
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2016-12-01