mirror of
https://github.com/svg/svgo.git
synced 2026-01-27 07:02:06 +03:00
26 lines
765 B
Plaintext
26 lines
765 B
Plaintext
---
|
|
title: Remove Dimensions
|
|
svgo:
|
|
pluginId: removeDimensions
|
|
---
|
|
|
|
Removes the [`width`](https://developer.mozilla.org/docs/Web/SVG/Attribute/width) and [`height`](https://developer.mozilla.org/docs/Web/SVG/Attribute/height) attribute from the top-most [`<svg>`](https://developer.mozilla.org/docs/Web/SVG/Element/svg) element if specified, and replaces it with the [`viewBox`](https://developer.mozilla.org/docs/Web/SVG/Attribute/viewBox) attribute if it's missing.
|
|
|
|
:::info
|
|
|
|
This is effectively the opposite of the [Remove ViewBox](/docs/plugins/remove-viewbox/) plugin, you should disable that before using this one.
|
|
|
|
:::
|
|
|
|
## Usage
|
|
|
|
<PluginUsage/>
|
|
|
|
## Demo
|
|
|
|
<PluginDemo/>
|
|
|
|
## Implementation
|
|
|
|
* https://github.com/svg/svgo/blob/main/plugins/removeDimensions.js
|