From ca60c9190622442eab1a1752f52adc61c5ed04c8 Mon Sep 17 00:00:00 2001 From: peterkogo Date: Mon, 5 May 2025 11:53:09 +0200 Subject: [PATCH] BackgroundProps tsdocs --- .../src/lib/plugins/Background/types.ts | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/svelte/src/lib/plugins/Background/types.ts b/packages/svelte/src/lib/plugins/Background/types.ts index c9c065f6..2e74491f 100644 --- a/packages/svelte/src/lib/plugins/Background/types.ts +++ b/packages/svelte/src/lib/plugins/Background/types.ts @@ -7,6 +7,7 @@ export enum BackgroundVariant { } export type BackgroundProps = { + /** When multiple backgrounds are present on the page, each one should have a unique id. */ id?: string; /** Color of the background */ bgColor?: string; @@ -16,13 +17,26 @@ export type BackgroundProps = { patternClass?: string; /** Class applied to the container */ class?: ClassValue; - /** Gap between repetitions of the pattern */ + /** + * The gap between patterns. Passing in a tuple allows you to control the x and y gap + * independently. + * @default 20 + */ gap?: number | [number, number]; - /** Size of a single pattern element */ + /** + * The radius of each dot or the size of each rectangle if `BackgroundVariant.Dots` or + * `BackgroundVariant.Cross` is used. This defaults to 1 or 6 respectively, or ignored if + * `BackgroundVariant.Lines` is used. + */ size?: number; - /** Line width of the Line pattern */ + /** + * The stroke thickness used when drawing the pattern. + * @default 1 + */ lineWidth?: number; - /** Variant of the pattern + /** + * Variant of the pattern. + * @default BackgroundVariant.Dots * @example BackgroundVariant.Lines, BackgroundVariant.Dots, BackgroundVariant.Cross * 'lines', 'dots', 'cross' */