vmware-clarity / core

Clarity is a scalable, accessible, customizable, open-source design system built with web components. Works with any JavaScript framework, created for enterprises, and designed to be inclusive.
https://clarity.design
MIT License
164 stars 42 forks source link

feat(icon): add css attributes with height and width of 100% in svg #239

Closed Kesonlin closed 1 year ago

Kesonlin commented 1 year ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the current behavior?

When we use custom icon which has it's own width and height like `

table-line
<path d="M8,34a1,1,0,0,1-1-1V2.92a1,1,0,0,1,2,0V33A1,1,0,0,1,8,34Z" class="clr-i-outline clr-i-outline-path-1"></path><path d="M17,33.92a1,1,0,0,1-1-1V9.1a1,1,0,1,1,2,0V32.92A1,1,0,0,1,17,33.92Z" class="clr-i-outline clr-i-outline-path-2"></path><path d="M26,34a1,1,0,0,1-1-1V9a1,1,0,0,1,2,0V33A1,1,0,0,1,26,34Z" class="clr-i-outline clr-i-outline-path-3"></path><path d="M33.11,18h-25a1,1,0,1,1,0-2h25a1,1,0,1,1,0,2Z" class="clr-i-outline clr-i-outline-path-4"></path><path d="M33.1,26.94H8.1A1,1,0,1,1,8.1,25h25a1,1,0,1,1,0,1.92Z" class="clr-i-outline clr-i-outline-path-5"></path><path d="M33,8.92H3A1,1,0,1,1,3,7H33a1,1,0,1,1,0,1.94Z" class="clr-i-outline clr-i-outline-path-6"></path>
<rect x="0" y="0" width="36" height="36" fill-opacity="0"/>

` we can't make it adaptive the width and height set in cds-icon

Issue Number: N/A

What is the new behavior?

No matter whether you set width and height in custom icon or not, the custom icon can adapt the width and height set in cds-icon.

Does this PR introduce a breaking change?

Other information

vmwclabot commented 1 year ago

@linhr123, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

github-actions[bot] commented 1 year ago

👋 @linhr123,

Thank you,

🤖 Clarity Release Bot

vmwclabot commented 1 year ago

@linhr123, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot commented 1 year ago

@linhr123, VMware has rejected your signed contributor license agreement. The merge can not proceed until the agreement has been resigned. Click here to resign the agreement. Reject reason:

VMware employees do not need to sign a CLA to have changes merged to a repository owned by a VMware organization. If you are a member of a VMware GitHub organization, you will not be prompted to sign a CLA when opening a pull request. If you are a VMware employee and you are prompted to sign a CLA, close the pull request where you are prompted to sign the CLA and navigate to VMware's internal Upstream Contrib and join the desired VMware organization. Accept the invitation to join the org & open a new PR.

vmwclabot commented 1 year ago

@linhr123, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot commented 1 year ago

@linhr123, VMware has rejected your signed contributor license agreement. The merge can not proceed until the agreement has been resigned. Click here to resign the agreement. Reject reason:

Please provide a full postal address.

vmwclabot commented 1 year ago

@linhr123, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot commented 1 year ago

@linhr123, VMware has approved your signed contributor license agreement.

bbogdanov commented 1 year ago

https://github.com/vmware-clarity/core/blob/e52d73c0f181a0aee17434c8cdf4b2299976d935/projects/core/src/icon/icon.element.scss#LL71C1-L75C2

This should do the same thing you are trying to achieve.

so <cds-icon size="fit">

github-actions[bot] commented 1 year ago

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed PRs after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.