layout.scss 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. .header,
  2. .body,
  3. .footer {
  4. box-sizing: border-box;
  5. }
  6. /* __________________________________ HEADER __________________________________ */
  7. .header {
  8. top: 0;
  9. margin: 0;
  10. padding-top: $page-margin-top;
  11. width: 100%;
  12. height: $header-height;
  13. text-align: left;
  14. &:after {
  15. content: $header-text;
  16. }
  17. }
  18. /* __________________________________ MAIN SECTION __________________________________ */
  19. .body {
  20. height: $page-height - $header-height - $footer-height;
  21. width: $page-width;
  22. margin-bottom: $page-margin-bottom;
  23. padding-top: $page-margin-top + $header-height;
  24. padding-bottom: $page-margin-bottom;
  25. position: absolute;
  26. }
  27. .recipient {
  28. -webkit-flow-from: myStory;
  29. flow-from: myStory;
  30. }
  31. #my-story {
  32. -webkit-flow-into: myStory;
  33. flow-into: myStory;
  34. }
  35. /* __________________________________ FOOTER __________________________________ */
  36. .footer {
  37. position: absolute;
  38. bottom: 0;
  39. margin: 0;
  40. width: 100%;
  41. height: $footer-height;
  42. text-align: center;
  43. &:after {
  44. content: $footer-text;
  45. }
  46. }
  47. /* mirrored pages */
  48. .paper {
  49. &:nth-child(odd) .header {
  50. text-align: right;
  51. }
  52. &:nth-child(odd) .header,
  53. &:nth-child(odd) .body,
  54. &:nth-child(odd) .footer {
  55. padding-left: $page-margin-inside;
  56. padding-right: $page-margin-outside;
  57. }
  58. &:nth-child(even) .header,
  59. &:nth-child(even) .body,
  60. &:nth-child(even) .footer {
  61. padding-left: $page-margin-outside;
  62. padding-right: $page-margin-inside;
  63. }
  64. }
  65. img {
  66. max-width: 100%;
  67. }
  68. h1,
  69. h2,
  70. h3,
  71. h4,
  72. h5,
  73. h6 {
  74. /* Avoids headings to be cut or to be orphans.
  75. * But it doesn't seem to work
  76. * if the element after has a page-break-inside avoid. It tries its best! */
  77. -webkit-region-break-inside: avoid;
  78. break-inside: avoid;
  79. -webkit-region-break-after: avoid;
  80. break-after: avoid;
  81. }
  82. /* AN EXAMPLE TO AVOID PAGE BREAK INSIDE,
  83. * HERE NO PARAGRAPH WILL BE CUT,
  84. * BUT YOU MIGHT WANT TO DEACTIVATE THIS */
  85. p {
  86. /*-webkit-region-break-inside: avoid;*/
  87. /* break-inside: avoid;*/
  88. }