bubkoo / html-to-image

✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
MIT License
5.4k stars 505 forks source link

feat: support extra content which will be added to style tag from svg #407

Open 2knu opened 1 year ago

2knu commented 1 year ago

Description

Add a new parameter extraStyleContent which can be used to pass extra css code to resulting svg.

Motivation and Context

This change can be used to fix the styling part of #345

Types of changes

Self Check before Merge

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 80.00% and no project coverage change.

Comparison is base (b751cbf) 62.93% compared to head (772ca32) 62.93%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #407 +/- ## ======================================= Coverage 62.93% 62.93% ======================================= Files 10 10 Lines 580 580 Branches 143 143 ======================================= Hits 365 365 Misses 151 151 Partials 64 64 ``` | [Impacted Files](https://app.codecov.io/gh/bubkoo/html-to-image/pull/407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96) | Coverage Δ | | |---|---|---| | [src/embed-webfonts.ts](https://app.codecov.io/gh/bubkoo/html-to-image/pull/407?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=%E5%B4%96#diff-c3JjL2VtYmVkLXdlYmZvbnRzLnRz) | `30.63% <80.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.