codeat3/blade-grommet-icons

一个易于在Laravel Blade视图中使用Grommet Icons的包。

1.9.0 2024-02-28 15:34 UTC

This package is auto-updated.

Last update: 2024-08-28 16:46:29 UTC


README

Blade Grommet Icons

Tests Latest Stable Version Total Downloads

一个易于在您的Laravel Blade视图中使用 Grommet 的包。

要查看所有可用的图标列表,请参阅 SVG 目录,或在 icons.grommet.io 预览。

要求

  • PHP 7.4 或更高版本
  • Laravel 8.0 或更高版本

安装

composer require codeat3/blade-grommet-icons

更新

当更新库时,请参阅 更新指南

Blade Icons

Blade Grommet Icons 在底层使用Blade Icons。有关附加功能,请参阅 Blade Icons 的readme。我们还建议使用此库 启用图标缓存

配置

Blade Grommet Icons 还提供了使用Blade Icons功能(如默认类、默认属性等)的能力。如果您想配置这些,请发布 blade-grommet-icons.php 配置文件。

php artisan vendor:publish --tag=blade-grommet-icons-config

用法

图标可以作为自闭合Blade组件使用,这些组件将被编译为SVG图标

<x-grommet-o-adjustments/>

您还可以向图标组件传递类

<x-grommet-o-adjustments class="w-6 h-6 text-gray-500"/>

甚至可以使用内联样式

<x-grommet-o-adjustments style="color: #555"/>

实心图标可以像这样引用

<x-grommet-s-adjustments/>

原始SVG图标

如果您想将原始SVG图标用作资产,可以使用以下方法发布它们

php artisan vendor:publish --tag=blade-grommet-icons --force

然后在您的视图中使用它们,如下所示

<img src="{{ asset('vendor/blade-grommet-icons/o-adjustments.svg') }}" width="10" height="10"/>

变更日志

请查看此存储库中的 CHANGELOG,以获取所有最近的变化。

维护者

Blade Grommet Icons 由Swapnil Sarwe开发和维护。

许可证

Blade Grommet Icons 是开源软件,许可协议为 MIT 许可证