Skip to content
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

fix: 用户为svg-icon图标设置auto尺寸问题 #811

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

gy190
Copy link

@gy190 gy190 commented Sep 26, 2022

背景描述

1、原有的部分功能型icon-font图标会被组件默认转成svg图标(兼容锁定模式)
1、用户侧可能设置了公共尺寸属性,即将width和height设置为auto。
2、svg存在两个尺寸设置,一个是浏览器认为的默认尺寸,一个是组件内设定的默认尺寸。 如果用户侧设置auto后,组件的默认尺寸(1em1em)会被覆盖,而浏览器会按照默认350px150px的尺寸渲染。

主要改动

经调研,无法更改svg图标默认尺寸大小。因为将组件内svg icon的默认1em*1em存尺寸 加上!important来覆盖用户侧的auto配置。

需要注意

icon font-face的方式设置尺寸通过font-size,默认转成svg后,由于默认宽高是1em, 因此也可以通过font-size方式设定svg图标的尺寸。 原则上不需要再设置width和height属性

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant