Refactor icons-svg@4.x with gulp
See original GitHub issueReact/React-Native/Vue/Angular各自社区实现对应支持tree shaking
的图标组件或指令,分支在仓库ant-design-icons下的next-v4
分支
- @ant-design/icons (React) @vagusX https://github.com/ant-design/ant-design-icons/pull/112
- @ant-design/icons-vue (Vue) @tangjinzhou https://github.com/ant-design/ant-design-icons/pull/153
- @ant-design/icons-angular (Angular) @wendzhue
- @ant-design/icons-react-native (React-Native) @bang88
各自社区支持tree shaking
的图标组件或指令实现后,即可去掉WIP:
前缀。
同时原来的icons-svg-legacy
可以考虑删除。
之后将next-v4
分支合并到master
分支上。
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:22 (15 by maintainers)
Top Results From Across the Web
Icons with SVG's minified and layered using gulp - Medium
This post is about a quick POC implementing SVG Icons and a quick Angular directive for generating SVG icons. The gulp task is...
Read more >A Gulp-Based External SVG Symbol Sprite Icon System
A Gulp-Based External SVG Symbol Sprite Icon System ... Font icons and data URI's in CSS content are a hack, while SVG icons...
Read more >Hiswe/gulp-svg-symbols: Convert svg files to symbols - GitHub
gulp -svg-symbols is a minimal plugin for gulp. It converts a bunch of svg files to a single svg file containing each one...
Read more >Gulp Vector SVG Icon (2) - SVG Repo
Free Gulp Vector Icon in SVG format. ✓ Download Free Gulp Vector and icons for commercial use. Gulp SVG vector illustration graphic art...
Read more >gulp-svg-sprite - npm
SVG sprites & stacks galore — Gulp plugin wrapping around svg-sprite that reads in a bunch of SVG files, optimizes them and creates...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
各个社区在开发时,可以先构建一次
@ant-design/icons-svg
(未发包),该包位于packages/icons-svg
。之后可使用lerna link
到对应社区的组件包进行开发。开发思路可以分为两个阶段:
@ant-design/icons-svg
中的抽象节点(asn, Abstract Node)。生成对应的ReactElement或者VNode。(Angular社区可以使用helpers中的renderIconDefinitionToSVGElement
渲染工具函数来渲染)。之后生成组件输出到src
目录。当然,也可以利用旧的构建好的组件重新编写一个函数组件即可。注意旧的组件就不再需要内部的图标集合(即可以删去)思路示例:
Angular (仅供参考)
生成效果:
React (仅供参考)
效果:
Vue (仅供参考)
确认一下命名风格:
短横线连字形式可以由
name + '-' + theme
得到,通常用于Vue
组件名称形式中account-book-filled
account-book-outlined
account-book-twotone