Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS using var() does not render when loading HTML to PDF #60

Open
martsve opened this issue Jun 24, 2024 · 3 comments
Open

CSS using var() does not render when loading HTML to PDF #60

martsve opened this issue Jun 24, 2024 · 3 comments

Comments

@martsve
Copy link

martsve commented Jun 24, 2024

Describe the bug
The following HTML does not result in a green background div. Only the bottom border is applied.

<html><head>
<style>
.alert {
    --bg: #d1e7dd;
    background-color: var(--bg);
    border-bottom: 1px solid black;
}
</style>
</head><body>
<div class='alert'>
  This box should be green (if VAR works) with a border bottom (if css applied).
</div></body></html>

To Reproduce

var document = new Document("index.hml");
document.Save("out.pdf", SaveFormat.Pdf);

Expected behavior
The box should be green with a border bottom.

Screenshots
Using Var():
bilde

Setting the background color without Var():
bilde

Desktop (please complete the following information):

  • OS: Windows
  • Version: Aspose.PDF v24.6.0
@arise-project
Copy link
Collaborator

Hello, @martsve I started researching this question.

@arise-project
Copy link
Collaborator

arise-project commented Aug 12, 2024

Hello, @martsve in case you free of use nodejs package of Aspose.PDF I found solution for you with postcss package to transform var to static css. Also Lightning CSS can be applicable and postcss-rs you can use as standalone util.

@arise-project
Copy link
Collaborator

Hello, @martsve task PDFNET-57863 is created to add support for css with var() style.

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

No branches or pull requests

2 participants