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(Icon): switch to non-deprecated href attribute #243

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/young-dots-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"astro-icon": patch
"www": patch
---

fix(Icon): switch to non-deprecated `href` attribute
natemoo-re marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion packages/core/components/Icon.astro
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const normalizedBody = renderData.body;
) : (
<Fragment>
{includeSymbol && <symbol id={id} set:html={normalizedBody} />}
<use xlink:href={`#${id}`} />
<use href={`#${id}`} />
</Fragment>
)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/www/src/content/docs/guides/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ import { Icon } from 'astro-icon/components'
<!-- First usage generates the following HTML -->
<svg data-icon="logo">
<symbol id="ai:uniqueid"><!-- contents of /src/icons/logo.svg --></symbol>
<use xlink:href="#ai:uniqueid"></use>
<use href="#ai:uniqueid"></use>
</svg>

<Icon name="logo" />
<!-- Additional usage generates the following HTML -->
<svg data-icon="logo">
<use xlink:href="#ai:uniqueid"></use>
<use href="#ai:uniqueid"></use>
</svg>
```

Expand Down
Loading