1
0
mirror of https://github.com/svg/svgo.git synced 2026-01-27 07:02:06 +03:00
Files
svgo/docs/03-plugins/inline-styles.mdx
Seth Falco 4c2cc1bbdb feat(inlineStyles): remove redundant presentation attrs (#1829)
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.
2023-11-11 12:43:13 +00:00

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