saison-graphique
clone your own copy | download snapshot

Snapshots | iceberg

Inside this repository

main.css
text/css

Download raw (5.7 KB)

/**
 * Computation
 */
/* EXTRA SPACE AROUND THE PAGE: BLEED + CROP */
/* GEOMETRY OF THE PAPER SHEET */
/* SIZE OF SPREAD */
/**
 * DEFINITION OF THE PAPER SHEET
 */
@page {
  size: 618mm 449mm;
  margin: 0;
}
/**
 * CANVAS
 */
@media all {
  body {
    margin: 0;
  }
  .h2p-paper {
    width: 618mm;
    height: 444mm;
    box-sizing: border-box;
    /* Crop marks */
    counter-increment: page-counter;
    /* utile ou non? pour éviter qu'un papier soit coupé par le format de la
        /* page lors de la conversion et l'arrondis des unités */
    page-break-inside: avoid;
    page-break-after: always;
    overflow: hidden;
    /* Crop marks */
    padding: 12mm;
    position: relative;
  }
  .h2p-paper .crops {
    width: 618mm;
    height: 444mm;
    position: absolute;
    top: 0;
    left: 0;
  }
  .h2p-paper .crops div {
    border-style: solid;
    border-color: black;
    border-width: 0;
    width: 12mm;
    height: 12mm;
    position: absolute;
    box-sizing: border-box;
  }
  .h2p-paper .crops div span {
    width: 7mm;
    height: 7mm;
    position: absolute;
    border-style: solid;
    border-color: black;
  }
  .h2p-paper .crops div span.bleed--horizontal {
    width: 7mm;
    height: 12mm;
  }
  .h2p-paper .crops div span.bleed-vertical {
    width: 12mm;
    height: 7mm;
  }
  .h2p-paper .crops .crop-top-left {
    top: 0;
    left: 0;
  }
  .h2p-paper .crops .crop-top-left span.bleed--horizontal {
    left: 0px;
    top: 0px;
    border-bottom-width: 1px;
  }
  .h2p-paper .crops .crop-top-left span.bleed--vertical {
    right: 0;
    top: 0;
    border-right-width: 1px;
  }
  .h2p-paper .crops .crop-top-right {
    top: 0;
    right: 0;
  }
  .h2p-paper .crops .crop-top-right span.bleed--horizontal {
    right: 0px;
    top: 0px;
    border-bottom-width: 1px;
  }
  .h2p-paper .crops .crop-top-right span.bleed--vertical {
    left: 0;
    top: 0;
    border-left-width: 1px;
  }
  .h2p-paper .crops .crop-bottom-right {
    right: 0;
    bottom: 0;
  }
  .h2p-paper .crops .crop-bottom-right span.bleed--horizontal {
    right: 0px;
    bottom: 0px;
    border-top-width: 1px;
  }
  .h2p-paper .crops .crop-bottom-right span.bleed--vertical {
    left: 0;
    bottom: 0;
    border-left-width: 1px;
  }
  .h2p-paper .crops .crop-bottom-left {
    left: 0;
    bottom: 0;
  }
  .h2p-paper .crops .crop-bottom-left span.bleed--horizontal {
    left: 0px;
    bottom: 0px;
    border-top-width: 1px;
  }
  .h2p-paper .crops .crop-bottom-left span.bleed--vertical {
    right: 0;
    bottom: 0;
    border-right-width: 1px;
  }
  .h2p-page {
    width: 594mm;
    height: 420mm;
    box-sizing: border-box;
    position: absolute;
    text-rendering: optimizeLegibility;
  }
}
@media screen {
  body {
    background-color: #F0F0F0 !important;
  }
  #h2p-pages {
    width: 618mm;
    height: 444mm;
    margin-left: auto;
    margin-right: auto;
  }
  .h2p-spread #h2p-pages {
    width: 1236mm;
    height: 888mm;
  }
  .h2p-paper {
    /* centrer la page à l'écran */
    background-color: white;
    margin-top: 1em;
    margin-bottom: 1em;
  }
}
@media print {
  html {
    width: 618mm;
  }
  body {
    /* Allows printing of background colors */
    background-color: white;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #h2p-pages {
    position: absolute;
    top: 0;
  }
}
/**
 * Helpers
 */
.h2p-region-break {
  /* Apply this class to an element to put it on a new region.
     * Hint: 
     * You can also use an empty <div class="page-break"></div> 
     * if you want to put manual page breaks without attaching it to an HTML element
     */
  -webkit-region-break-before: always;
}
.h2p-header,
.h2p-body,
.h2p-footer {
  box-sizing: border-box;
}
/* __________________________________ HEADER __________________________________ */
.h2p-header {
  /*position: absolute;*/
  /*margin-top: @page-margin-top;*/
  margin: 0;
  padding-top: 0;
  height: 0mm;
  text-align: left;
  padding-right: 15mm !important;
}
.h2p-header:after {
  content: "";
  right: 15mm !important;
}
/* __________________________________ MAIN SECTION __________________________________ */
.h2p-body {
  height: 405mm;
  width: 100%;
  padding-top: 0;
  overflow: hidden;
}
/* __________________________________ FOOTER __________________________________ */
.h2p-footer {
  margin: 0;
  width: 100%;
  height: 0mm;
  text-align: center;
}
.h2p-footer:after {
  content: "";
}
/* for spreads only */
.h2p-paper:nth-child(odd) .header {
  text-align: right;
}
.h2p-paper:nth-child(odd) .header,
.h2p-paper:nth-child(odd) .body,
.h2p-paper:nth-child(odd) .footer {
  padding-left: 15mm;
  padding-right: 15mm;
}
.h2p-paper:nth-child(even) .header,
.h2p-paper:nth-child(even) .body,
.h2p-paper:nth-child(even) .footer {
  padding-left: 15mm;
  padding-right: 15mm;
}
body {
  text-rendering: optimizeLegibility;
}
img {
  max-width: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  /* Avoids headings to be cut or to be orphans.
     * But it doesn't seem to work
     * if the element after has a page-break-inside avoid. It tries its best! */
  -webkit-region-break-inside: avoid;
  -webkit-region-break-after: avoid;
  break-inside: avoid;
  break-after: avoid;
}
/* AN EXAMPLE TO AVOID PAGE BREAK INSIDE,
 * HERE NO PARAGRAPH WILL BE CUT,
 * BUT YOU MIGHT WANT TO DEACTIVATE THIS */
p {
  /*-webkit-region-break-inside: avoid;*/
}
* {
  -webkit-font-feature-settings: "liga", "dlig", "clig", "kern";
}
.debug .h2p-header {
  outline: 1pt solid pink;
}
.debug .h2p-body {
  outline: 1pt solid purple;
}
.debug .h2p-footer {
  outline: 1pt solid pink;
}
/* PAGE FORMAT */
/* CROP MARKS */
/* BLEED */
/* MARGINS */
/* HEADER & FOOTER */
/* FLOW */
.h2p-recipient {
  -webkit-flow-from: myArticle;
  flow-from: myArticle;
}
#h2p-content {
  -webkit-flow-into: myArticle;
  flow-into: myArticle;
}