Bootstrap Icons v1.0.0 稳定版发布,开源 SVG 图标库
经历了 5 个 alpha 版本后,Bootstrap Icons 已于近日正式发布 v1.0.0 稳定版。目前该图标库已拥有超过 1100 个图标,团队计划在即将发布的小版本中再为其增加数百个图标。
自第五个 alpha 版本发布以来,团队已经重新绘制了超过三分之一的图标,主要是因为对路径和形状进行了微调。这里的大部分重绘和改进都是为图标字体(icon font)做准备,但遗憾的是,由于从 SVG 生成字体的工具未够完善,所以图标字体被推迟到了 v1.1.0 版本。
安装
通过 npm 安装:
npm i bootstrap-icons
或者从 GitHub 下载新版本,或仅下载 SVG 文件(不包含仓库的其他文件)。
用法
根据自己的设置,可以通过多种方式将 Bootstrap Icons 添加到项目:
- 将 SVG 复制粘贴为内嵌式的 HTML 元素
<svg class="bi bi-chevron-right" width="32" height="32" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M6.646 3.646a.5.5 0 01.708 0l6 6a.5.5 0 010 .708l-6 6a.5.5 0 01-.708-.708L12.293 10 6.646 4.354a.5.5 0 010-.708z"/></svg>
- 通过
<img>
元素引用
<img src="/assets/img/bootstrap.svg" alt="" width="32" height="32" title="Bootstrap">
- 使用 SVG sprite
<svg class="bi" width="32" height="32" fill="currentColor"> <use xlink:href="bootstrap-icons.svg#heart-fill"/> </svg> <svg class="bi" width="32" height="32" fill="currentColor"> <use xlink:href="bootstrap-icons.svg#toggles"/> </svg> <svg class="bi" width="32" height="32" fill="currentColor"> <use xlink:href="bootstrap-icons.svg#shop"/> </svg>
- 通过 CSS 引入
.bi::before { display: inline-block; content: ""; background-image: url("data:image/svg+xml,<svg viewBox='0 0 16 16' fill='%23333' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' d='M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z' clip-rule='evenodd'/></svg>"); background-repeat: no-repeat; background-size: 1rem 1rem; }

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Flutter 1.21.0-9.2.pre 发布
Flutter 1.21.0-9.2.pre 发布了,更新内容: 更新引擎哈希 对于弱模式,在计算中允许为 null [Material]确保时间选择器输入模式在 RTL 中正确布置 修复customer-testing [flutter_tool] 处理 packages_test.dart 中的 Windows 行尾 [flutter_tool] 修复了 Windows 上的一些 create_test.dart 测试 更新说明:https://github.com/flutter/flutter/releases/tag/1.21.0-9.2.pre
- 下一篇
Prometheus 2.21.0-rc.0 发布,Go 编写的服务监控系统
Prometheus 2.21.0-rc.0 发布了,此版本使用 Go 1.15 构建,该版本弃用了TLS 证书验证中的X.509 CommonName。 新特性 Eureka SD:新的服务发现 Hetzner SD:新服务发现 Kubernetes SD:支持 Kubernetes EndpointSlices Scrape:新增scrape-config 目标限制 Bug fix PromQL:删除两个即时向量之间的布尔比较中的指标名称 Rules:检测规则文件中的其他字段 Rules:禁止在记录规则的“标签”部分覆盖指标名称 Rules:每次重新加载时都要保留评估时间戳 Scrape:重新加载时请勿停止 scrape TSDB:修复chunks.HeadReadWriter: maxt of the files are not seterror TSDB:自动删除块,以防止在删除过程中出现紧急情况/崩溃时损坏 Triton SD:修复当 triton_sd_config 为 nil 时的 panic UI:修复 react UI bug Web:即使连接过时也要停止 CMUX ...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- SpringBoot2更换Tomcat为Jetty,小型站点的福音
- SpringBoot2整合Redis,开启缓存,提高访问速度
- Docker安装Oracle12C,快速搭建Oracle学习环境
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- Windows10,CentOS7,CentOS8安装Nodejs环境
- CentOS8安装MyCat,轻松搞定数据库的读写分离、垂直分库、水平分库
- Red5直播服务器,属于Java语言的直播服务器
- SpringBoot2整合Thymeleaf,官方推荐html解决方案
- CentOS7设置SWAP分区,小内存服务器的救世主
- Jdk安装(Linux,MacOS,Windows),包含三大操作系统的最全安装