You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if this is very specific, but I'm stuck with an issue with WeasyPrint and I hope someone here can help me:
I use WeasyPrint via pandoc for a static-site project to also generate a PDF version of the website (you can find the source here).
I have a bunch of <code> elements that are styled depending on their CSS classes (all have the class tag and another class e.g. must to determine which type of tag it is) and this works successfully in the browser. I apply different styles using @print as well, since browser drop the background-color, but that shouldn't be relevant here.
Turns out in WeasyPrint, it seems like for some reason, I cannot style these elements at all using classes. I've tried a bunch of things, but I was unable to figure out a solution for this, so by now I'm thinking this might be a bug.
/* Works */
code {
background-color: red;
}
/* Doesn't work */
.tag {
background-color: red;
}
Here's the output of WeasyPrint, but I don't see anything relevant here:
WARNING: Ignored `box-shadow: 0px 1px 0px 1px rgba(0,0,0,0.1)` at 84:3, unknown property.
WARNING: Ignored `max-width: calc(100% - 0.8rem)` at 118:3, invalid value.
WARNING: Ignored `box-shadow: 0px 1px 0px 1px rgba(255, 255, 255, 0.1)` at 168:3, unknown property.
WARNING: Ignored `box-shadow: none` at 187:3, unknown property.
WARNING: Ignored `height: calc(100vh - 2rem)` at 217:3, invalid value.
WARNING: Ignored `overflow-y: scroll` at 218:3, unknown property.
WARNING: Ignored `user-select: none` at 276:3, unknown property.
WARNING: Ignored `box-shadow: 0px 1px 0px 1px rgba(0,0,0,0.1)` at 277:3, unknown property.
WARNING: Ignored `user-select: none` at 308:3, unknown property.
WARNING: Expected a media type, got screen/**/and/**/(max-width: 1024px)
WARNING: Invalid media type " screen and (max-width: 1024px) " the whole @media rule was ignored at 349:1.
WARNING: Ignored `box-shadow: 0px 1px 0px 1px #060` at 397:5, unknown property.
WARNING: Ignored `box-shadow: 0px 1px 0px 1px #a00` at 401:5, unknown property.
WARNING: Ignored `box-shadow: 0px 1px 0px 1px #2c2` at 405:5, unknown property.
WARNING: Ignored `box-shadow: 0px 1px 0px 1px #d46` at 409:5, unknown property.
WARNING: Ignored `box-shadow: 0px 1px 0px 1px #ea5` at 413:5, unknown property.
WARNING: Ignored `overflow-y: auto` at 445:5, unknown property.
WARNING: Anchor defined twice: language-en
WARNING: Anchor defined twice: language-de
Any help – including pointers what I'm doing wrong, if so – would be really appreciated.
The text was updated successfully, but these errors were encountered:
burnoutberni
changed the title
Unable to style code element using CSS class
Unable to style <code> element using CSS class
Oct 12, 2019
Ah no, it's not pandoc eating up anything -- the class attributes are supposed to be applied by script.js -- but WeasyPrint doesn't execute JavaScript.
Cf. #817
Sorry if this is very specific, but I'm stuck with an issue with WeasyPrint and I hope someone here can help me:
I use WeasyPrint via pandoc for a static-site project to also generate a PDF version of the website (you can find the source here).
I have a bunch of
<code>
elements that are styled depending on their CSS classes (all have the classtag
and another class e.g.must
to determine which type of tag it is) and this works successfully in the browser. I apply different styles using@print
as well, since browser drop the background-color, but that shouldn't be relevant here.Turns out in WeasyPrint, it seems like for some reason, I cannot style these elements at all using classes. I've tried a bunch of things, but I was unable to figure out a solution for this, so by now I'm thinking this might be a bug.
Here's the output of WeasyPrint, but I don't see anything relevant here:
Any help – including pointers what I'm doing wrong, if so – would be really appreciated.
The text was updated successfully, but these errors were encountered: