diff --git a/.prettierignore b/.prettierignore
index 104baae59..9f8c74141 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -9,3 +9,4 @@ src/react/index.ts
node_modules
package-lock.json
tsconfig.json
+cdn
diff --git a/docs/_includes/default.njk b/docs/_includes/default.njk
index 2a29169d4..a7b7e8b23 100644
--- a/docs/_includes/default.njk
+++ b/docs/_includes/default.njk
@@ -34,9 +34,9 @@
{# Shoelace #}
-
-
-
+
+
+
{# Set the initial theme and menu states here to prevent flashing #}
\n` +
+ `\n` +
`\n${htmlExample}`;
jsTemplate = '';
}
@@ -191,10 +193,10 @@
jsTemplate =
`import React from 'https://cdn.skypack.dev/react@${reactVersion}';\n` +
`import ReactDOM from 'https://cdn.skypack.dev/react-dom@${reactVersion}';\n` +
- `import { setBasePath } from 'https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}/%CDNDIR%/utilities/base-path';\n` +
+ `import { setBasePath } from 'https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}/${cdndir}/utilities/base-path';\n` +
`\n` +
`// Set the base path for Shoelace assets\n` +
- `setBasePath('https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}/%NPMDIR%/')\n` +
+ `setBasePath('https://cdn.skypack.dev/@shoelace-style/shoelace@${shoelaceVersion}/${npmdir}/')\n` +
`\n${convertModuleLinks(reactExample)}\n` +
`\n` +
`ReactDOM.render(, document.getElementById('root'));`;
@@ -202,7 +204,7 @@
// CSS templates
cssTemplate =
- `@import 'https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@${shoelaceVersion}/%CDNDIR%/themes/${
+ `@import 'https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@${shoelaceVersion}/${cdndir}/themes/${
isDark ? 'dark' : 'light'
}.css';\n` +
'\n' +
diff --git a/docs/pages/components/icon.md b/docs/pages/components/icon.md
index 2b6a301a6..66e85bede 100644
--- a/docs/pages/components/icon.md
+++ b/docs/pages/components/icon.md
@@ -634,6 +634,39 @@ This example will load the same set of icons from the jsDelivr CDN instead of yo
```
+#### Customize the default library to use SVG sprites
+
+To improve performance you can use a SVG sprites to avoid multiple trips for each SVG. The browser will load the sprite sheet once and then you reference the particular SVG within the sprite sheet using hash selector.
+
+As always, make sure to benchmark these changes. When using HTTP/2, it may in fact be more bandwidth-friendly to use multiple small requests instead of 1 large sprite sheet.
+
+:::danger
+When using sprite sheets, the `sl-load` and `sl-error` events will not fire.
+:::
+
+:::danger
+For security reasons, browsers may apply the same-origin policy on `