CSS @page rule seems to be ignored if imported by @import rule
See original GitHub issueHello,
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
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
import - CSS: Cascading Style Sheets - MDN Web Docs
The @import CSS at-rule is used to import style rules from other valid stylesheets. An @import rule must be defined at the top...
Read more >CSS @import and the order of it - Stack Overflow
The '@import' rule allows users to import style rules from other style sheets. In CSS 2.1, any @import rules must precede all other...
Read more >@import · WebPlatform Docs
The rule has no default value. The semicolon in the syntax is required; if omitted, the style sheet is not imported properly and...
Read more >Beware of @import rules when concatenating CSS files
Be careful when using @import rules in CSS files that are concatenated before being deployed.
Read more >Solving the React Error: Not Picking Up CSS Style | Pluralsight
Here, the CSS file is saved outside the src folder, so the compiler failed to import it. To make this code work, you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, it is.
@liZe Okay, thanks. Is the fix commit merged in master?