@stnd/icon 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/Icon.svelte +9 -0
- package/package.json +1 -1
- package/tokens.js +0 -1
package/CHANGELOG.md
CHANGED
package/Icon.svelte
CHANGED
|
@@ -55,6 +55,15 @@
|
|
|
55
55
|
})
|
|
56
56
|
.then((text) => {
|
|
57
57
|
if (!isCancelled) {
|
|
58
|
+
// An app with an SPA fallback answers a missing icon with its own
|
|
59
|
+
// index.html and a 200, so `res.ok` proves nothing. Injecting that
|
|
60
|
+
// page via {@html} drops its <link rel="stylesheet"> into the
|
|
61
|
+
// document — a second copy of the app CSS, last in tree order, that
|
|
62
|
+
// re-asserts the framework defaults over the active theme for as
|
|
63
|
+
// long as the icon is mounted (Reveal's photo menu, 2026-09-30).
|
|
64
|
+
if (!/^\s*(<\?xml[^>]*>\s*)?(<!--[\s\S]*?-->\s*)*<svg[\s>]/i.test(text)) {
|
|
65
|
+
throw new Error(`Not an SVG: ${currentSrc}`);
|
|
66
|
+
}
|
|
58
67
|
// Ensure SVG scales properly by injecting a viewBox if missing
|
|
59
68
|
if (!text.includes("viewBox=")) {
|
|
60
69
|
const widthMatch = text.match(/<svg[^>]*\swidth="([^"]+)"/);
|
package/package.json
CHANGED