css-gradient-parser is a JavaScript/TypeScript library designed to parse CSS gradient strings, specifically developed to extend gradient feature support within the Vercel Satori library. Currently at version 0.0.18, it provides distinct functions for parsing linear, radial, and conic gradients, including their `repeating` variations. As a pre-1.0 project, its release cadence is likely irregular, with features and API potentially evolving rapidly. Its primary differentiator is its targeted integration with Satori, aiming to bridge the gap in gradient rendering capabilities for server-side image generation, though it can be used independently for general CSS gradient parsing needs.
npm install css-gradient-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to parse various CSS gradient types (linear, radial, conic, repeating) using their respective functions and logs the structured output.
Pin to exact versions in production environments. Regularly review the package's GitHub repository and documentation for API changes when upgrading.
Thoroughly test complex or non-standard gradient syntaxes if not using with Satori. Review Satori's documentation for any known gradient parsing specifics.
Ensure your Node.js environment is version 16 or newer. For browser usage, configure your build tools (e.g., Babel, esbuild, Webpack) to transpile to a compatible JavaScript target.
Ensure you are using ES module `import` syntax: `import { parseLinearGradient } from 'css-gradient-parser';`Verify that your gradient string is valid CSS syntax. Check the library's README for supported gradient features and report any valid but unparsed gradients as an issue.
Debug the exact input gradient string that causes the error. Simplify the gradient to isolate the problematic part. If the gradient is standard CSS, consider submitting a bug report to the library's maintainers with the problematic string.
No dependency data recorded yet.