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-Style "fill:" not accepted for inline svgs #1258

Closed
phorward opened this issue Dec 1, 2020 · 1 comment
Closed

CSS-Style "fill:" not accepted for inline svgs #1258

phorward opened this issue Dec 1, 2020 · 1 comment

Comments

@phorward
Copy link

phorward commented Dec 1, 2020

Hello there,

I just want to render a web-site with an embedded SVG using weasyprint, where polygons should be filled with a specific (generated) color.

This is the HTML-Code

<html>
<head>
	<meta charset="utf-8">
	<style>
		#cart-item-5134723546349568 polygon.shape-part-1 {
			fill: #ed8b01;
		}

		#cart-item-5134723546349568 polygon.shape-part-2 {
			fill: #412884;
		}
	</style>
</head>
<body>
	<div id="cart-item-5134723546349568">
		<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 295.9 841.9">
			<polygon class="shape-part-1" points="0,399 0,841.9 295.9,841.9 295.9,399 148,633.6 "></polygon>
			<polygon class="shape-part-2" points="0,0 0,233.9 0,278.1 148,512.7 295.9,278.1 295.9,233.9 295.9,0 "></polygon>
		</svg>
	</div>
</body>
</html>

But weasyprint prints these error lines:

$ weasyprint http://localhost:8080/s/test test.png
WARNING: Ignored `fill: #ed8b01` at 3:4, unknown property.
WARNING: Ignored `fill: #412884` at 7:4, unknown property.

This seems to be the same issue like #283, but I don't understand the answer posted there, and there's also no example to follow (404).

As far as i know, fill is a valid CSS property to use in combination with inline svgs. It also works without problems directly in Chromium. Is there any work-around for this? I think this is not a bug, and I do something wrong.

Edit1: I just cleaned the HTML-Code a little bit.

@liZe
Copy link
Member

liZe commented Dec 1, 2020

Hello! Thank you for reporting this issue.

The problem is that inline SVG images are not supported. That’s a duplicate of #75.

@liZe liZe closed this as completed Dec 1, 2020
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