striped-background
Version:
Generate customizable striped backgrounds using CSS gradients
12 lines (11 loc) • 662 B
TypeScript
type AngleUnit = "deg" | "grad" | "rad" | "turn";
export type AngleString = `${number}${AngleUnit | ""}`;
/**
* @param pattern Array of tuples
* @param angle Pattern rotation angle.
* Number or numeric string will be treated as degrees.
* String can contain CSS angle unit, e.g. `45deg`, `50grad`, `0.7854rad`, `0.125turn`
* @param offset Pattern offset, in pixels
*/
export default function stripedBackground(pattern: [color: string, length: number][], angle?: number | AngleString, offset?: number): Partial<Pick<CSSStyleDeclaration, "backgroundImage" | "backgroundSize" | "backgroundPosition" | "backgroundColor">>;
export {};