-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed5034f
commit 6c18d57
Showing
8 changed files
with
60 additions
and
68 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# createGroups | ||
|
||
Creates `<g>` elements containing common properties for adjacent siblings. | ||
|
||
## Details | ||
|
||
The plugin has no effect if: | ||
|
||
- The document has scripts. | ||
- The document has `<style>` elements with CSS which **svgo-ll** is not able to process. | ||
- The `<style>` element contains at least one rule. | ||
|
||
Groups are only created for children of `<svg>` and `<g>` elements. | ||
|
||
Adjacent siblings which have at least one common property are combined into a group. The following properties will be moved to the group if shared by all elements: | ||
|
||
- Any inheritable properties. | ||
- The `transform` and `transform-origin` properties, except that if both are present in the children, they are not moved to the group unless both can be moved. | ||
|
||
All common properties are written to the group element as part of the `style` attribute, except for `transform`, which is written as an attribute. | ||
|
||
The following are never put into a group: | ||
|
||
- Elements which are referenced by a `<use>` element. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# removeHiddenElems | ||
|
||
Removes [non-rendered elements](https://svgwg.org/svg2-draft/render.html#TermNeverRenderedElement) that are not used. | ||
|
||
## Details | ||
|
||
The plugin has no effect if: | ||
|
||
- The document has scripts. | ||
- The document has `<style>` elements with CSS which **svgo-ll** is not able to process. | ||
- The `<style>` element has features other than simple selectors or attribute selectors. | ||
|
||
The following elements are removed, except as specified below: | ||
|
||
- Any children of `<defs>` which have no id. | ||
- If a non-rendering element with no `id` attribute is encountered outside of a `<defs>`, the element is changed to a `<defs>`, and its content is processed as above. | ||
- Empty shape elements with no id. | ||
- Elements with `display:none`. | ||
- Elements with `opacity:0`. | ||
|
||
The following are not removed: | ||
|
||
- `<style>` and `<script>` children of `<defs>`. | ||
- If a child of `<defs>` has no `id` attribute, it may contain descendants which have an `id` attribute. If this is the case, these descendants are moved up to become immediate children of the `<defs>` element. | ||
- `<marker>` elements with `display:none`. | ||
- `<g>` elements with `display:none` (these are converted to a `<defs>`, and their content is processed as above). | ||
- Elements with `opacity:0` which are within a non-rendering element which is not removed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters