mirror of
https://github.com/svg/svgo.git
synced 2026-01-27 07:02:06 +03:00
29 lines
795 B
Plaintext
29 lines
795 B
Plaintext
---
|
|
title: Collapse Groups
|
|
svgo:
|
|
pluginId: collapseGroups
|
|
defaultPlugin: true
|
|
---
|
|
|
|
Finds groups that effectively do nothing and flattens them, preserving the contents of the groups.
|
|
|
|
Groups can be formed using the [`<g>`](https://developer.mozilla.org/docs/Web/SVG/Element/g) element. They're used for organizing the document, or applying [presentation attributes](https://developer.mozilla.org/docs/Web/SVG/Attribute/Presentation) to all children contained in a group.
|
|
|
|
:::info
|
|
|
|
This plugin doesn't remove empty groups. That's handled by the [**Remove Empty Containers**](/docs/plugins/remove-empty-containers/) plugin which is enabled by default.
|
|
|
|
:::
|
|
|
|
## Usage
|
|
|
|
<PluginUsage/>
|
|
|
|
## Demo
|
|
|
|
<PluginDemo/>
|
|
|
|
## Implementation
|
|
|
|
* https://github.com/svg/svgo/blob/main/plugins/collapseGroups.js
|