Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pagedjs
pagedjs
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 144
    • Issues 144
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 8
    • Merge Requests 8
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Tools
  • pagedjspagedjs
  • Issues
  • #94

Closed
Open
Opened Jan 14, 2019 by Mauro@mb21
  • Report abuse
  • New issue
Report abuse New issue

Merge @page rules from different CSS sources

Having two @page rules in the same CSS file, or in the same <style> element works as expected.

But if you have two non-empty @page rules in two separate elements (or files), the cascade doesn't work.

Minimal repro:

<!DOCTYPE html>
<html>
  <head>
    <style>
    @page {
      size: A4;
    }
    </style>
    <style>
    @page {
      margin-top: 6cm;
    }
    </style>
  </head>
  <body>
    <h1>foo</h1>
    <script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
  </body>
</html>
  • Expected: the margin-top pushes down the foo header in the layout.
  • Actual: the margin-top is ignored.

Thanks for looking into this! I'm happy to help in any way I can. But looking at the code, I'm uncertain about some of the reasoning that went into it. And I don't want to invest a lot of time in a pull request if you prefer to fix it yourself / your way...

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
2
Labels
@page rule(s) source files
Assign labels
  • View project labels
Reference: tools/pagedjs#94