Skip to content

CSS Print corner case #2676

@cmahnke

Description

@cmahnke

This is probably not a real bug, but a current limitation of the model. The CSS Paged Media Module Level 3 (and earlier versions) describe a @page at-rule:

Example 2 of the specification

@page :left {
margin-left: 3cm;
margin-right: 4cm;
}

@page :right {
margin-left: 4cm;
margin-right: 3cm;
}

Translated to SASS this should look like this:

@page {
  size: 210mm 210mm !important;
  margin-top: 1cm;
  margin-bottom: 1cm;

  & :left {
    margin-left: 1cm;
    margin-right: 2cm;
  }

  & :right {
    margin-left: 2cm;
    margin-right: 1cm;
  }
}

But this currently not supported: Top-level selectors may not contain the parent selector "&". Please consider enhancing the model to support such constructs.
The example might not make it not instantly clear, but taking into account that there is also the concept of a named page (think of templates for types like foreword, TOC, indexes) this will certainly make more sense.
I'm aware the the CSS printing (and related) modules aren't very well supported by browsers, but they are by specialized tools, see print-css.rocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions