2021-10-17 18:26:00 +02:00
|
|
|
---
|
2022-10-02 00:27:09 +02:00
|
|
|
title: plugin-theme
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
Published as [@freesewing/plugin-theme][1], this plugin provides CSS for
|
|
|
|
your SVG document when rendering to SVG.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
```sh
|
2021-08-25 16:09:31 +02:00
|
|
|
npm install @freesewing/plugin-theme
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
|
|
|
design, or [add it to a pattern instance with
|
|
|
|
Pattern.use()](/reference/api/pattern/use).
|
2021-12-27 17:33:49 +01:00
|
|
|
|
2022-12-13 04:39:07 -08:00
|
|
|
To import the plugin for use:
|
|
|
|
```js
|
|
|
|
import { themePlugin } from '@freesewing/plugin-theme'
|
|
|
|
// or
|
|
|
|
import { pluginTheme } from '@freesewing/plugin-theme'
|
|
|
|
```
|
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
## Notes
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
This plugin will inject CSS in the SVG document when rendering to SVG.
|
|
|
|
|
|
|
|
If you use other ways to render your pattern (using `Pattern.getRenderProps()`)
|
|
|
|
you will need to apply your own styles.
|
|
|
|
|
|
|
|
[1]: https://www.npmjs.com/package/@freesewing/plugin-theme
|