又一款开源图标库 CSS.GG,值得一用

栏目: IT技术 · 发布时间: 3年前

内容简介:嗨,我是我们平常找图标往往会去

又一款开源图标库 CSS.GG,值得一用

嗨,我是 Martin ,也叫老王,今天推荐一款好用的开源图标库。

我们平常找图标往往会去 iconfont

又一款开源图标库 CSS.GG,值得一用

但是今天,我们看了 Martin 的文章之后,就会有一个新的选择—— CSS.GG

又一款开源图标库 CSS.GG,值得一用

Github

https://github.com/astrit/css.gg

star 5751
fork 214
Watch 86

700 +CSS , SVG & Figma UI Icons 可用在 SVG 精灵图, styled-components , NPM & API

使用方法

通过 npm or yarn 安装最新版本

npm i css.gg
yarn add css.gg

使用该包

该包,包含以下目录和文件:

Path What it is
/css individual *.css icons
/scss individual *.scss icons
/svg individual *.svg icons
/tsx individual *.tsx icons styled-components
/all.css all icons compressed in a single file
/all.d.ts styled-components
/all.fig local figma file same as https://css.gg/fig
/all.js list of exported styled-components
/all.js.map styled-components
/all.json all icons *.css, *.svg, *.tsx including markup & public path
/all.scss all icons in a single SCSS file npm i node-sass needed
/all.svg SVG Sprite with all icons
/all.xd local adobe xd file same as https://css.gg/xd
/all.xml all icons *.css, *.svg, *.tsx including markup & public path

HTML 导入

1. All icons

<!-- css.gg -->
<link href='https://css.gg/css' rel='stylesheet'>

<!-- UNPKG -->
<link href='https://unpkg.com/css.gg/icons/all.css' rel='stylesheet'>

<!-- JSDelivr -->
<link href='https://cdn.jsdelivr.net/npm/css.gg/icons/all.css' rel='stylesheet'>

2. Single icon

<!-- css.gg -->
<link href='https://css.gg/ {ICONNAME} .css' rel='stylesheet'>

<!-- UNPKG -->
<link href='https://unpkg.com/css.gg/icons/css/ {ICONNAME} .css' rel='stylesheet'>

<!-- JSDelivr -->
<link href='https://cdn.jsdelivr.net/npm/css.gg/icons/css/ {ICONNAME} .css' rel='stylesheet'>

3. Collection

<!-- CSS Format -->
<link href='https://css.gg/css?= {ICONNAME} | {ICONNAME}' rel='stylesheet'>

4. Markup

<i></i>

<!-- reference icon using span -->
<span></span>

<!-- reference icon using div -->
<div></div>

<!-- reference icon using custom tag -->
<gg-icon></gg-icon>

5. Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <!-- You can add this link or any other CDN alternatives as mentioned above -->
    <link href='https://css.gg/css' rel='stylesheet'>

</head>
<body>

    <!-- Using i tag  -->
    <i></i>

    <!-- Using div tag  -->
    <div></div>

    <!-- Using custom tag  -->
    <gg-icon></gg-icon>

</body>
</html>

其他方式

关注我们

今天的分享就到这里,点赞、收藏、留言,三连。

记得关注我们哟,送你一份前端大礼包。

又一款开源图标库 CSS.GG,值得一用


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

口碑

口碑

[美] David Meerman Scott / 高游、郭成钢、薛松 / 人民邮电出版社 / 2010-10 / 25.00

Web 2.0时代,怎样让你的产品或创意风靡一时,为百万大众喜闻乐道?本书将为你揭开其中的奥秘。作者将理论创新与实务操作相结合,总结出了利用Web 2.0营销手段制造网络狂欢效应的六条金科玉律,并介绍了一个个生动鲜活的成功范例,如:哈利?波特魔法公园如何策划一场小型活动,达到引爆网络热潮的效果;贝克?霍尔克拉夫特如何通过网络发布音乐作品,从默默无闻成长为全球炙手可热的明星;看似平淡无奇的电子书,如......一起来看看 《口碑》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换