-
Notifications
You must be signed in to change notification settings - Fork 579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Icon]支持svg的icon #1839
Labels
Comments
|
|
争议点:
|
我也觉得 Icon 应该同时支持 svg & unicode 两种形式,目前 pc 端主流都是 svg。。这点 antd 可能就比较好 |
跨端融合项目需要支持mobile小程序,强制不支持svg标签,当前task 暂时hold,待重启 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Component
Icon
Feature Description
优势
改造点
组件
为保证兼容,iconfont格式在基础组件的导出中仍然要保留(因为更改了dom结构,用户对iconfont格式的覆盖会失效),但配置平台导出的主题包可以提供选择让用户只加载其中一种。
改造点
<SvgIcon />
作为新组件加入Next(用不到的用户可以被按需加载处理掉)—— P0<SvgIcon />
支持设置style(font-size, color) 、size等,保证用户迁移成本基本为0 —— P0改造方案
SvgIcon
,使用方式如下创建小包 @alifd/next-icons 存储默认icon的svg模式,小包目录结构为:
next大包结构如下:
对于@alifd/next:
dist/next.min.js
dist/next.js
中增加内置的基础icon(这样,默认情况下会有两份icon,一份svg、一份css)配置平台
对于 @alifd/theme-xxxx:
dist/next.min.js
dist/next.js
包含基础+自定义icon —— P0对于平台:
修改@alifd/next-theme-template,增加dist/svgicon.min.js
(功能相当于icon.scss), 为工程提供svg素材 —— P0dist/next.min.js
dist/next.js
包含自定义的icon —— P0工程配套
改造点
新增一个类似@alifd/next-theme-webpack-plugin的插件,引入主题下的全量(新方案默认通过类似组件引入的方式实现,icon不需要再特殊处理 )SvgIcon
—— P0升级ice插件(新方案默认通过类似组件引入的方式实现,icon不需要再特殊处理 )ice-plugin-fusion
支持全量引入SvgIcon
—— P0SvgIcon
按需引入 —— P2FusionCool
// 接入 svg 格式的icon
基本没有影响,需要确认
The text was updated successfully, but these errors were encountered: