1
0
Fork 0
freesewing/markdown/dev/reference/plugins/theme/en.md
2022-02-19 08:04:25 +01:00

929 B

title
@freesewing/plugin-theme

The @freesewing-plugin-theme plugin provides CSS styling for SVG output. It leverages the preRender lifecycle hook to accomplish this.

Only applies to SVG/PS/PDF output

This plugin will inject CSS in the SVG document when rendering to SVG.

If you use other ways to render your pattern (like our React component) you will need to apply your own styles.

Installation

npm install @freesewing/plugin-theme

Usage

Like all run-time plugins, you load them by by passing them to the use() method of an instatiated pattern.

That method is chainable, so if you have multiple plugins you can just chain them together.

import Aaron from "@freesewing/aaron";
import theme from "@freesewing/plugin-theme";

const pattern = new Aaron().use(theme);