vite-imagetools
Advanced tools
Comparing version 2.3.1 to 2.3.2
{ | ||
"name": "vite-imagetools", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.mjs", |
@@ -101,2 +101,7 @@ # vite-imagetools :toolbox: | ||
Resizes the image to have a with of `width` pixels. If not set, the height will be scaled automatically to match the width. | ||
```typescript | ||
import Image from "example.jpg?width=300" | ||
``` | ||
> You cannot use `with` and `size` together. | ||
@@ -108,2 +113,7 @@ | ||
Resize the image to have a height of `height` pixels. If not set, the width will be scaled automatically to match the height. | ||
```typescript | ||
import Image from "example.jpg?height=300" | ||
``` | ||
> You cannot use `height` and `size` together. | ||
@@ -113,4 +123,9 @@ | ||
#### `size` | ||
**Argument**: <_number_>x<_number_><br/> | ||
**Argument**: <_width_>x<_height_><br/> | ||
Sets width and height of the image simultaneously. | ||
```typescript | ||
import Image from "example.jpg?size=1920x1080" | ||
``` | ||
> When using `size` you cannot set `width` or `height`on the same resource. | ||
@@ -190,7 +205,7 @@ | ||
Optionally you can use one of the Shorthands below like so: | ||
```html | ||
<!-- instead of --> | ||
<img src="example.jpg?format=webp"> | ||
<!-- you can write --> | ||
<img src="example.jpg?webp"> | ||
```typescript | ||
// instead of | ||
import Image from "example.jpg?format=webp" | ||
// you can write | ||
import Image from "example.jpg?webp" | ||
``` | ||
@@ -197,0 +212,0 @@ **Shorthands**: |
64815
275