Skip to content

Commit 9ee7549

Browse files
Sync kit docs (#1656)
sync kit docs Co-authored-by: svelte-docs-bot[bot] <196124396+svelte-docs-bot[bot]@users.noreply.github.com>
1 parent 050bad7 commit 9ee7549

File tree

1 file changed

+3
-1
lines changed
  • apps/svelte.dev/content/docs/kit/40-best-practices

1 file changed

+3
-1
lines changed

apps/svelte.dev/content/docs/kit/40-best-practices/07-images.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ You can also use [Vite's `import.meta.glob`](https://vitejs.dev/guide/features.h
8585
```svelte
8686
<script>
8787
const imageModules = import.meta.glob(
88-
'/path/to/assets/*.{avif,gif,heif,jpeg,jpg,png,tiff,webp,svg}',
88+
'/path/to/assets/*.{avif,gif,heif,jpeg,jpg,png,tiff,webp}',
8989
{
9090
eager: true,
9191
query: {
@@ -100,6 +100,8 @@ You can also use [Vite's `import.meta.glob`](https://vitejs.dev/guide/features.h
100100
{/each}
101101
```
102102

103+
> [!NOTE] svg images are currently only supported statically
104+
103105
### Intrinsic Dimensions
104106

105107
`width` and `height` are optional as they can be inferred from the source image and will be automatically added when the `<enhanced:img>` tag is preprocessed. With these attributes, the browser can reserve the correct amount of space, preventing [layout shift](https://web.dev/articles/cls). If you'd like to use a different `width` and `height` you can style the image with CSS. Because the preprocessor adds a `width` and `height` for you, if you'd like one of the dimensions to be automatically calculated then you will need to specify that:

0 commit comments

Comments
 (0)