siteation / magento2-hyva-icons-bootstrap
Hyva Themes 的 Bootstrap 图标
1.0.4
2023-11-26 11:51 UTC
Requires
- hyva-themes/magento2-theme-module: >=1.1.12
README
此 Magento 2 模块添加了在 Hyva 前端使用 Bootstrap Icons 的选项。
这要求您有一个正常工作的 Hyva 前端,此图标包专门为 Hyva 主题制作,不能与其他前端直接使用。
安装
通过以下方式安装包;
composer require siteation/magento2-hyva-icons-bootstrap bin/magento setup:upgrade
此模块需要 Magento 2.4 或更高版本,并需要 Hyva!有关更多要求,请参阅
composer.json
。
如何使用
默认情况下,此模块不加载任何内容。
要使用此图标包代替默认的 Hyva 图标,请在您的 phtml 文件中添加以下内容;
<?php use Hyva\Theme\Model\ViewModelRegistry; use Siteation\HyvaIconsBootstrap\ViewModel\BootstrapIcons; /** @var ViewModelRegistry $viewModels */ /** @var BootstrapIcons $bootstrapIcons */ $bootstrapIcons = $viewModels->require(BootstrapIcons::class);
并像在 Hyva 中使用 HeroIcons 一样使用 Bootstrap 图标;
<?= $bootstrapIcons->listHtml('p-1', 24, 24, ["aria-label" => "Open menu"]) ?>
在 CMS 内容中使用 SVG 图标
现在您还可以在您的 CMS 内容中使用 SVG 图标。
将 svg 图标支持带到您的 CMS 页面、块和小部件中。
{{icon "bootstrap/list"}}
此功能自 Hyva v1.1.12 开始支持
其他 Hyva 图标包
- 有关图标包,请参阅 https://github.com/topics/hyva-icons
如果您正在寻找基于 Luma 的选项,请查看此图标包。
图标许可证
在此模块中使用的 Bootstrap Icons 由 The Bootstrap Authors 创建,采用 MIT 许可证,可在以下位置找到