Skip to content

Conversation

dashi0
Copy link

@dashi0 dashi0 commented Aug 11, 2025

Summary

This PR adds support for CSS Color Module Level 4 syntax to html2canvas, specifically the color() function and relative color syntax with rgb(from ...) and hsl(from ...).

This PR fixes/implements the following bugs/features

  • Bug: "Attempting to parse an unsupported color function" error when using CSS4 color syntax
  • Feature: Support for color(srgb r g b / alpha) syntax
  • Breaking changes

Motivation

CSS Color Module Level 4 introduces new color functions and relative color syntax that are increasingly being used in modern web applications. Without this support, html2canvas throws errors when encountering these color functions, preventing proper rendering of elements that use this modern CSS syntax.

The specific issue was:

@dashi0 dashi0 changed the title feat: Add support for CSS Color Module Level 4 syntax (color(), rgb(from ...), hsl(from ...)) feat: Add support for CSS Color Module Level 4 syntax color(...) Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant