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 @page rule seems to be ignored if imported by @import rule #520

Closed
berndnicklas opened this issue Oct 6, 2017 · 6 comments
Closed
Labels
bug Existing features not working as expected
Milestone

Comments

@berndnicklas
Copy link

berndnicklas commented Oct 6, 2017

Hello,

while referencing a file pagerule.css containing

/* rule #1 */
@page {
  size: A4;
  margin-top: 1.5cm;
  margin-right: 1.5cm;
  margin-bottom: 1.5cm;
  margin-left: 2.5cm;
}

/* rule #2 */
body {
  background-color: lime;
}

directly in HTML via

<link rel="stylesheet" href="pagerule.css" />

works like a charm, it seems that importing the file via CSS

@import url("pagerule.css");

or

@import url("pagerule.css") all;

into a referenced CSS file only processes rule #2 while rule #1 (the page rule) is completely ignored. On weasyprint command line interface with verbosity switched on, no warnings or errors are printed.

In Chrome print preview this is rendered correctly.

Is this a bug or intended behaviour?

Best regards,

Bernd

@liZe liZe modified the milestones: v0.41, v0.42 Oct 6, 2017
@liZe liZe closed this as completed in 3fb6747 Oct 6, 2017
@liZe
Copy link
Member

liZe commented Oct 6, 2017

What a dirty bug! Thanks for your really explicit report!

@liZe liZe added the bug Existing features not working as expected label Oct 6, 2017
@berndnicklas
Copy link
Author

Thank's for your quick fix!

@kination
Copy link

kination commented Nov 15, 2017

@liZe I'm also facing with same bug. Is fixed version released?

@liZe
Copy link
Member

liZe commented Nov 15, 2017

@liZe I'm also facing with same bug. Is fixed version released?

No, it's not released yet, there's a couple of issues I'd like to fix before the next version.

@kination
Copy link

@liZe Okay, thanks. Is the fix commit merged in master?

@liZe
Copy link
Member

liZe commented Nov 16, 2017

Is the fix commit merged in master?

Yes, it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants