承接 ianreid/iconlibrairies 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ianreid/iconlibrairies

最新稳定版本:1.0

Composer 安装命令:

composer require ianreid/iconlibrairies

包简介

SVG icon libraries integration with Craft CMS's native SVG function.

README 文档

README

Icon Libraries plugin icon

Icon Libraries for Craft CMS

Easily integrate various SVG icon libraries with Craft CMS's native SVG function.

Requirements

This plugin requires Craft CMS 4.x or later

Installation

To install the plugin, follow these instructions.

  1. In your terminal, go to your Craft project:

     cd /path/to/project
    
  2. Use Composer to load and install the plugin:

     composer require ianreid/iconlibrairies -w && php craft plugin/install icon-librairies
    

Usage

To utilize the SVGs from the provided libraries, you can simply use the Craft CMS's native SVG function:

{{ svg('@phosphor/shield.svg')|attr({ class: 'w-8 h-8 text-gray-500' }) }}

Example: For using an icon from the phosphor icons library:

{{ svg('@heroicons/o-arrow-right.svg')|attr({ class: 'w-8 h-8 text-green-500' }) }}

Available Icon Libraries

  • Phosphor
  • Heroicons - When using an icon from Heroicons, prefix the icon name with:
    • o- for outline icons
    • s- for solid icons
    • m- for mini icons

SVG Sanitization and Namespacing

By default, if you use the native SVG function, the SVG will be sanitized of potentially malicious scripts using svg-sanitizer, and any IDs or class names within the document will be namespaced so they don’t conflict with other IDs or class names in the DOM. You can disable those behaviors using the sanitize and namespace arguments:

{{ svg('@phosphor/shield.svg', sanitize=false, namespace=false) }}

This plugin is brought to you by Ian Reid Langevin

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-04