-
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
6b0d646
commit f01342c
Showing
5 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
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,28 @@ | ||
# cleanupStyleAttributes | ||
|
||
Removes invalid style properties and unreferenced class attribute names. | ||
|
||
## 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. | ||
|
||
### `style` Attributes | ||
|
||
Properties that are not valid for a particular element are removed. | ||
|
||
For `<g>` elements whose only children are shapes, properties relating to text and fonts are removed. | ||
|
||
The `style` attribute is removed from all animation elements. | ||
|
||
The list of allowable properties comes from https://www.w3.org/TR/SVG2/styling.html#PresentationAttributes, and also includes the `font` shorthand property. | ||
|
||
Style attributes are not changed if the document has attribute selectors on the `style` attribute. | ||
|
||
### `class` Attributes | ||
|
||
Any class names in the `class` attribute which are not referenced by a style selector are removed. If all class names are removed, the class attribute is removed. | ||
|
||
Class attributes are not changed if the document has attribute selectors on the `class` attribute. |
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
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