pdf_viewer.css 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /* Copyright 2014 Mozilla Foundation
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. @import url(text_layer_builder.css);
  16. @import url(annotation_layer_builder.css);
  17. @import url(xfa_layer_builder.css);
  18. @import url(annotation_editor_layer_builder.css);
  19. :root {
  20. --viewer-container-height: 0;
  21. --pdfViewer-padding-bottom: 0;
  22. --page-margin: 1px auto -8px;
  23. --page-border: 9px solid transparent;
  24. --page-border-image: url(images/shadow.png) 9 9 repeat;
  25. --spreadHorizontalWrapped-margin-LR: -3.5px;
  26. --scale-factor: 1;
  27. }
  28. @media screen and (forced-colors: active) {
  29. :root {
  30. --pdfViewer-padding-bottom: 9px;
  31. --page-margin: 8px auto -1px;
  32. --page-border: 1px solid CanvasText;
  33. --page-border-image: none;
  34. --spreadHorizontalWrapped-margin-LR: 3.5px;
  35. }
  36. }
  37. [data-main-rotation="90"] {
  38. transform: rotate(90deg) translateY(-100%);
  39. }
  40. [data-main-rotation="180"] {
  41. transform: rotate(180deg) translate(-100%, -100%);
  42. }
  43. [data-main-rotation="270"] {
  44. transform: rotate(270deg) translateX(-100%);
  45. }
  46. .pdfViewer {
  47. padding-bottom: var(--pdfViewer-padding-bottom);
  48. }
  49. .pdfViewer .canvasWrapper {
  50. overflow: hidden;
  51. width: 100%;
  52. height: 100%;
  53. z-index: 1;
  54. }
  55. .pdfViewer .page {
  56. direction: ltr;
  57. width: 816px;
  58. height: 1056px;
  59. margin: var(--page-margin);
  60. position: relative;
  61. overflow: visible;
  62. border: var(--page-border);
  63. border-image: var(--page-border-image);
  64. background-clip: content-box;
  65. background-color: rgba(255, 255, 255, 1);
  66. }
  67. .pdfViewer .dummyPage {
  68. position: relative;
  69. width: 0;
  70. height: var(--viewer-container-height);
  71. }
  72. .pdfViewer.removePageBorders .page {
  73. margin: 0 auto 10px;
  74. border: none;
  75. }
  76. .pdfViewer.singlePageView {
  77. display: inline-block;
  78. }
  79. .pdfViewer.singlePageView .page {
  80. margin: 0;
  81. border: none;
  82. }
  83. .pdfViewer.scrollHorizontal,
  84. .pdfViewer.scrollWrapped,
  85. .spread {
  86. margin-left: 3.5px;
  87. margin-right: 3.5px;
  88. text-align: center;
  89. }
  90. .pdfViewer.scrollHorizontal,
  91. .spread {
  92. white-space: nowrap;
  93. }
  94. .pdfViewer.removePageBorders,
  95. .pdfViewer.scrollHorizontal .spread,
  96. .pdfViewer.scrollWrapped .spread {
  97. margin-left: 0;
  98. margin-right: 0;
  99. }
  100. .spread .page,
  101. .spread .dummyPage,
  102. .pdfViewer.scrollHorizontal .page,
  103. .pdfViewer.scrollWrapped .page,
  104. .pdfViewer.scrollHorizontal .spread,
  105. .pdfViewer.scrollWrapped .spread {
  106. display: inline-block;
  107. vertical-align: middle;
  108. }
  109. .spread .page,
  110. .pdfViewer.scrollHorizontal .page,
  111. .pdfViewer.scrollWrapped .page {
  112. margin-left: var(--spreadHorizontalWrapped-margin-LR);
  113. margin-right: var(--spreadHorizontalWrapped-margin-LR);
  114. }
  115. .pdfViewer.removePageBorders .spread .page,
  116. .pdfViewer.removePageBorders.scrollHorizontal .page,
  117. .pdfViewer.removePageBorders.scrollWrapped .page {
  118. margin-left: 5px;
  119. margin-right: 5px;
  120. }
  121. .pdfViewer .page canvas {
  122. margin: 0;
  123. display: block;
  124. }
  125. .pdfViewer .page canvas[hidden] {
  126. display: none;
  127. }
  128. .pdfViewer .page canvas[zooming] {
  129. width: 100%;
  130. height: 100%;
  131. }
  132. .pdfViewer .page .loadingIcon {
  133. position: absolute;
  134. display: block;
  135. left: 0;
  136. top: 0;
  137. right: 0;
  138. bottom: 0;
  139. background: url("images/loading-icon.gif") center no-repeat;
  140. z-index: 5;
  141. }
  142. .pdfViewer .page .loadingIcon.notVisible {
  143. background: none;
  144. }
  145. .pdfViewer.enablePermissions .textLayer span {
  146. user-select: none !important;
  147. cursor: not-allowed;
  148. }
  149. .pdfPresentationMode .pdfViewer {
  150. padding-bottom: 0;
  151. }
  152. .pdfPresentationMode .spread {
  153. margin: 0;
  154. }
  155. .pdfPresentationMode .pdfViewer .page {
  156. margin: 0 auto;
  157. border: 2px solid transparent;
  158. }