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

CSS @page rule seems to be ignored if imported by @import rule #520

berndnicklas opened this issue Oct 6, 2017 · 6 comments
Labels
bug
Milestone

Comments

@berndnicklas
Copy link

@berndnicklas 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 in 3fb6747 Oct 6, 2017
@liZe
Copy link
Member

@liZe liZe commented Oct 6, 2017

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

@liZe liZe added the bug label Oct 6, 2017
@berndnicklas
Copy link
Author

@berndnicklas berndnicklas commented Oct 9, 2017

Thank's for your quick fix!

@djKooks
Copy link

@djKooks djKooks commented Nov 15, 2017

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

@liZe
Copy link
Member

@liZe 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.

@djKooks
Copy link

@djKooks djKooks commented Nov 15, 2017

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

@liZe
Copy link
Member

@liZe 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.