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(comp:empty): resolve id conflicts in svg #1451

Merged
merged 1 commit into from Feb 20, 2023

Conversation

danranVm
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

  • 解决带有渐变的 svg 图标在同时渲染多个时,可能存在 id 冲突的问题。
  • 移除了 imgae 100% height 的样式

What is the new behavior?

Other information

@idux-bot
Copy link

idux-bot bot commented Feb 16, 2023

This preview will be available after the AzureCI is passed.

svg {
height: 100%;
margin: auto;
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with a code review:

First, it looks like the align-items and justify-content styles were added to center the text. This is a good improvement since it ensures that the text will be centered regardless of the size of its container.

Second, the height: 100% style was removed from the &-image selector. This can be a problem in some cases, as it could cause the image to not scale properly. To avoid this issue, you may want to consider replacing this style with width: 100%, which will ensure that the image scales proportionally.

Third, the height: 100% style was also removed from the svg selector. This could have the same issue as the one mentioned above, so it's best to replace it with width: 100% to ensure the SVG scales proportionally.

Finally, there is no bug risk in the code patch, so no improvements are necessary.

Overall, the code patch looks good and should ensure that the text is always centered in its container. However, it's important to make sure that the images and SVGs scale correctly by using width: 100% instead of height: 100%.

@codecov
Copy link

codecov bot commented Feb 16, 2023

Codecov Report

Merging #1451 (8ec1c3e) into main (388da6a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 8ec1c3e differs from pull request most recent head 876477e. Consider uploading reports for the commit 876477e to get more accurate results

@@           Coverage Diff           @@
##             main    #1451   +/-   ##
=======================================
  Coverage   92.98%   92.99%           
=======================================
  Files         327      327           
  Lines       30350    30377   +27     
  Branches     2560     2560           
=======================================
+ Hits        28221    28248   +27     
  Misses       2129     2129           
Impacted Files Coverage Δ
packages/components/empty/src/Images.tsx 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@danranVm danranVm merged commit 8ca7a08 into IDuxFE:main Feb 20, 2023
@danranVm danranVm deleted the fix-empty-svg-id branch February 20, 2023 01:29
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