mirror of
https://github.com/svg/svgo.git
synced 2026-01-27 07:02:06 +03:00
SVGs can have the same presentation attribute declared redundantly in both the node attributes and `<style>` tag. This wouldn't break anything, but we can shave off a few more bytes by dropping the attribute in this case.
36 lines
1014 B
Plaintext
36 lines
1014 B
Plaintext
---
|
|
title: Inline Styles
|
|
svgo:
|
|
pluginId: inlineStyles
|
|
defaultPlugin: true
|
|
parameters:
|
|
onlyMatchedOnce:
|
|
description: If to only inline styles if the selector matches one element.
|
|
default: true
|
|
removeMatchedSelectors:
|
|
description: If to remove the selector and styles from the stylesheet while inlining the styles. This does not remove selectors that did not match any elements.
|
|
default: true
|
|
useMqs:
|
|
description: An array of media query conditions to use, such as <code>screen</code>. An empty string signifies all selectors outside of a media query.
|
|
usePseudos:
|
|
description: What pseudo-classes and pseudo-elements to use. An empty string signifies all non-pseudo-classes and non-pseudo-elements.
|
|
---
|
|
|
|
Merges styles from `<style>` elements to the `style` attribute of matching elements.
|
|
|
|
## Usage
|
|
|
|
<PluginUsage/>
|
|
|
|
### Parameters
|
|
|
|
<PluginParams/>
|
|
|
|
## Demo
|
|
|
|
<PluginDemo/>
|
|
|
|
## Implementation
|
|
|
|
* https://github.com/svg/svgo/blob/main/plugins/inlineStyles.js
|