Skip to content

Commit

Permalink
fix(Icon): switch to non-deprecated href attribute (#243)
Browse files Browse the repository at this point in the history
* fix(Icon): switch to non-deprecated href attribute

* docs(components): update usages in components guide

* docs: add changeset

* Update .changeset/young-dots-tell.md

---------

Co-authored-by: Nate Moore <[email protected]>
  • Loading branch information
stramel and natemoo-re authored Nov 5, 2024
1 parent ff3a66a commit a8c0a6c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
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
---

Replaces deprecated `xlink:href` attribute with standard `href` attribute
2 changes: 1 addition & 1 deletion packages/core/components/Icon.astro
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ if (includeSymbol) {
) : (
<Fragment>
{includeSymbol && <symbol id={id} viewBox={viewBox} 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 @@ -56,13 +56,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

0 comments on commit a8c0a6c

Please sign in to comment.