Skip to content

Commit

Permalink
always include viewBox in symbol element
Browse files Browse the repository at this point in the history
  • Loading branch information
azhirov committed Sep 5, 2024
1 parent 1f54a47 commit c9b8653
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/components/Icon.astro
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ if (props.size) {
const renderData = iconToSVG(iconData);
const normalizedProps = { ...renderData.attributes, ...props };
const normalizedBody = renderData.body;
const symbolProps = isSymbol ? { viewBox: renderData.attributes.viewBox } : {};
const symbolProps = { viewBox: renderData.attributes.viewBox };
---
{
isSymbol && !inline
Expand All @@ -125,7 +125,7 @@ const symbolProps = isSymbol ? { viewBox: renderData.attributes.viewBox } : {};
<Fragment id={id} set:html={normalizedBody} />
) : (
<Fragment>
{includeSymbol && <symbol id={id} set:html={normalizedBody} />}
{includeSymbol && <symbol id={id} set:html={normalizedBody} {...symbolProps} />}
<use xlink:href={`#${id}`} />
</Fragment>
)
Expand Down

0 comments on commit c9b8653

Please sign in to comment.