1
0
Fork 0
freesewing/sites/dev/docs/reference/api/svg/style/readme.mdx

41 lines
573 B
Text
Raw Normal View History

---
title: Svg.style
---
The `Svg.style` property holds a string that will be rendered as the style
section of the SVG document.
## Signature
2025-05-19 17:25:17 -07:00
```js
String svg.style += 'circle {stroke:black;}'
```
Result:
```
<style type="text/css">
2025-05-19 17:25:17 -07:00
circle {
stroke: black;
}
</style>
```
## Notes
The style property is where plugins will add additional styling.
2022-02-19 08:04:25 +01: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
```
2022-02-19 08:04:25 +01:00
and don't do this:
```js
svg.style = myStyles
```