2021-10-17 17:34:55 +02:00
|
|
|
***
|
|
|
|
|
|
|
|
## title: style
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
A string that will be rendered as the style section of the SVG document.
|
|
|
|
|
|
|
|
The style attribute is where plugins will add additional snippets.
|
|
|
|
|
|
|
|
```svg
|
|
|
|
<style type="text/css">
|
|
|
|
/* svg.style will be inserted */
|
|
|
|
</style>
|
|
|
|
```
|
|
|
|
|
|
|
|
<Warning>
|
|
|
|
|
|
|
|
###### Add, but don't overwrite
|
2021-10-17 17:34:55 +02:00
|
|
|
|
2021-08-25 16:09:31 +02:00
|
|
|
When adding your own styles, it's important not to
|
|
|
|
overwrite this property, but rather add your own.
|
|
|
|
|
|
|
|
In other words, do this:
|
|
|
|
|
|
|
|
```js
|
|
|
|
svg.style += myStyles;
|
|
|
|
```
|
2021-10-17 17:34:55 +02:00
|
|
|
|
2021-08-25 16:09:31 +02:00
|
|
|
and don't do this:
|
|
|
|
|
|
|
|
```js
|
|
|
|
svg.style = myStyles;
|
|
|
|
```
|
|
|
|
|
|
|
|
</Warning>
|