Skip to content

Commit a8c0a6c

Browse files
stramelnatemoo-re
andauthored
fix(Icon): switch to non-deprecated href attribute (#243)
* 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]>
1 parent ff3a66a commit a8c0a6c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.changeset/young-dots-tell.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"astro-icon": patch
3+
"www": patch
4+
---
5+
6+
Replaces deprecated `xlink:href` attribute with standard `href` attribute

packages/core/components/Icon.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ if (includeSymbol) {
130130
) : (
131131
<Fragment>
132132
{includeSymbol && <symbol id={id} viewBox={viewBox} set:html={normalizedBody} />}
133-
<use xlink:href={`#${id}`} />
133+
<use href={`#${id}`} />
134134
</Fragment>
135135
)
136136
}

packages/www/src/content/docs/guides/components.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ import { Icon } from 'astro-icon/components'
5656
<!-- First usage generates the following HTML -->
5757
<svg data-icon="logo">
5858
<symbol id="ai:uniqueid"><!-- contents of /src/icons/logo.svg --></symbol>
59-
<use xlink:href="#ai:uniqueid"></use>
59+
<use href="#ai:uniqueid"></use>
6060
</svg>
6161
6262
<Icon name="logo" />
6363
<!-- Additional usage generates the following HTML -->
6464
<svg data-icon="logo">
65-
<use xlink:href="#ai:uniqueid"></use>
65+
<use href="#ai:uniqueid"></use>
6666
</svg>
6767
```
6868

0 commit comments

Comments
 (0)