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

stroke, stroke-width SVG CSS "Presentational" attributes giving "unknown property" #832

Closed
saschwarz opened this issue Mar 24, 2019 · 3 comments

Comments

@saschwarz
Copy link

I'm using CSS in my site to define the stroke color and stroke-width according to user preferences within some SVGs and I'm getting:

# weasyprint source.html source.pdf
WARNING: Ignored `stroke: black` at 3:7, unknown property.
WARNING: Ignored `stroke-width: 0.4px` at 4:7, unknown property.
WARNING: Ignored `stroke-width: 0.1px` at 8:7, unknown property.
WARNING: Ignored `stroke: black` at 9:7, unknown property.

I'm defining them in the head > style of my HTML:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>A Title</title>
  <style>
    rect {
      stroke: black;
      stroke-width: 0.4px;
    }

    line {
      stroke-width: 0.1px;
      stroke: black;
    }

    text {
      font-family: monospace;
    }
  </style>
</head>

Is it possible to support these CSS attributes?

@liZe
Copy link
Member

liZe commented Mar 25, 2019

Hello!

Inline SVG files are not supported (see #75), but you can include them using embed or img tags, and put the stylesheet in the SVG.

@liZe
Copy link
Member

liZe commented Mar 25, 2019

@saschwarz If the solution is OK for you, you can close this issue (as it's basically a duplicate of #75).

@saschwarz
Copy link
Author

Thanks @liZe I'll see if I can apply the approaches in #75 to my situation.

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