annotation_layer_builder.css 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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. :root {
  16. --annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");
  17. --input-focus-border-color: Highlight;
  18. --input-focus-outline: 1px solid Canvas;
  19. --input-unfocused-border-color: transparent;
  20. --input-disabled-border-color: transparent;
  21. --input-hover-border-color: black;
  22. }
  23. @media (forced-colors: active) {
  24. :root {
  25. --input-focus-border-color: CanvasText;
  26. --input-unfocused-border-color: ActiveText;
  27. --input-disabled-border-color: GrayText;
  28. --input-hover-border-color: Highlight;
  29. }
  30. .annotationLayer .textWidgetAnnotation input:required,
  31. .annotationLayer .textWidgetAnnotation textarea:required,
  32. .annotationLayer .choiceWidgetAnnotation select:required,
  33. .annotationLayer .buttonWidgetAnnotation.checkBox input:required,
  34. .annotationLayer .buttonWidgetAnnotation.radioButton input:required {
  35. outline: 1.5px solid selectedItem;
  36. }
  37. }
  38. .annotationLayer {
  39. position: absolute;
  40. top: 0;
  41. left: 0;
  42. pointer-events: none;
  43. transform-origin: 0 0;
  44. z-index: 3;
  45. }
  46. .annotationLayer section {
  47. position: absolute;
  48. text-align: initial;
  49. pointer-events: auto;
  50. box-sizing: border-box;
  51. transform-origin: 0 0;
  52. }
  53. .annotationLayer .linkAnnotation > a,
  54. .annotationLayer .buttonWidgetAnnotation.pushButton > a {
  55. position: absolute;
  56. font-size: 1em;
  57. top: 0;
  58. left: 0;
  59. width: 100%;
  60. height: 100%;
  61. }
  62. .annotationLayer .buttonWidgetAnnotation.pushButton > canvas {
  63. width: 100%;
  64. height: 100%;
  65. }
  66. .annotationLayer .linkAnnotation > a:hover,
  67. .annotationLayer .buttonWidgetAnnotation.pushButton > a:hover {
  68. opacity: 0.2;
  69. background: rgba(255, 255, 0, 1);
  70. box-shadow: 0 2px 10px rgba(255, 255, 0, 1);
  71. }
  72. .annotationLayer .textAnnotation img {
  73. position: absolute;
  74. cursor: pointer;
  75. width: 100%;
  76. height: 100%;
  77. }
  78. .annotationLayer .textWidgetAnnotation input,
  79. .annotationLayer .textWidgetAnnotation textarea,
  80. .annotationLayer .choiceWidgetAnnotation select,
  81. .annotationLayer .buttonWidgetAnnotation.checkBox input,
  82. .annotationLayer .buttonWidgetAnnotation.radioButton input {
  83. background-image: var(--annotation-unfocused-field-background);
  84. border: 2px solid var(--input-unfocused-border-color);
  85. box-sizing: border-box;
  86. font: calc(9px * var(--scale-factor)) sans-serif;
  87. height: 100%;
  88. margin: 0;
  89. vertical-align: top;
  90. width: 100%;
  91. }
  92. .annotationLayer .textWidgetAnnotation input:required,
  93. .annotationLayer .textWidgetAnnotation textarea:required,
  94. .annotationLayer .choiceWidgetAnnotation select:required,
  95. .annotationLayer .buttonWidgetAnnotation.checkBox input:required,
  96. .annotationLayer .buttonWidgetAnnotation.radioButton input:required {
  97. outline: 1.5px solid red;
  98. }
  99. .annotationLayer .choiceWidgetAnnotation select option {
  100. padding: 0;
  101. }
  102. .annotationLayer .buttonWidgetAnnotation.radioButton input {
  103. border-radius: 50%;
  104. }
  105. .annotationLayer .textWidgetAnnotation textarea {
  106. resize: none;
  107. }
  108. .annotationLayer .textWidgetAnnotation input[disabled],
  109. .annotationLayer .textWidgetAnnotation textarea[disabled],
  110. .annotationLayer .choiceWidgetAnnotation select[disabled],
  111. .annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],
  112. .annotationLayer .buttonWidgetAnnotation.radioButton input[disabled] {
  113. background: none;
  114. border: 2px solid var(--input-disabled-border-color);
  115. cursor: not-allowed;
  116. }
  117. .annotationLayer .textWidgetAnnotation input:hover,
  118. .annotationLayer .textWidgetAnnotation textarea:hover,
  119. .annotationLayer .choiceWidgetAnnotation select:hover,
  120. .annotationLayer .buttonWidgetAnnotation.checkBox input:hover,
  121. .annotationLayer .buttonWidgetAnnotation.radioButton input:hover {
  122. border: 2px solid var(--input-hover-border-color);
  123. }
  124. .annotationLayer .textWidgetAnnotation input:hover,
  125. .annotationLayer .textWidgetAnnotation textarea:hover,
  126. .annotationLayer .choiceWidgetAnnotation select:hover,
  127. .annotationLayer .buttonWidgetAnnotation.checkBox input:hover {
  128. border-radius: 2px;
  129. }
  130. .annotationLayer .textWidgetAnnotation input:focus,
  131. .annotationLayer .textWidgetAnnotation textarea:focus,
  132. .annotationLayer .choiceWidgetAnnotation select:focus {
  133. background: none;
  134. border: 2px solid var(--input-focus-border-color);
  135. border-radius: 2px;
  136. outline: var(--input-focus-outline);
  137. }
  138. .annotationLayer .buttonWidgetAnnotation.checkBox :focus,
  139. .annotationLayer .buttonWidgetAnnotation.radioButton :focus {
  140. background-image: none;
  141. background-color: transparent;
  142. }
  143. .annotationLayer .buttonWidgetAnnotation.checkBox :focus {
  144. border: 2px solid var(--input-focus-border-color);
  145. border-radius: 2px;
  146. outline: var(--input-focus-outline);
  147. }
  148. .annotationLayer .buttonWidgetAnnotation.radioButton :focus {
  149. border: 2px solid var(--input-focus-border-color);
  150. outline: var(--input-focus-outline);
  151. }
  152. .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
  153. .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,
  154. .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
  155. background-color: CanvasText;
  156. content: "";
  157. display: block;
  158. position: absolute;
  159. }
  160. .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
  161. .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
  162. height: 80%;
  163. left: 45%;
  164. width: 1px;
  165. }
  166. .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before {
  167. transform: rotate(45deg);
  168. }
  169. .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
  170. transform: rotate(-45deg);
  171. }
  172. .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
  173. border-radius: 50%;
  174. height: 50%;
  175. left: 30%;
  176. top: 20%;
  177. width: 50%;
  178. }
  179. .annotationLayer .textWidgetAnnotation input.comb {
  180. font-family: monospace;
  181. padding-left: 2px;
  182. padding-right: 0;
  183. }
  184. .annotationLayer .textWidgetAnnotation input.comb:focus {
  185. /*
  186. * Letter spacing is placed on the right side of each character. Hence, the
  187. * letter spacing of the last character may be placed outside the visible
  188. * area, causing horizontal scrolling. We avoid this by extending the width
  189. * when the element has focus and revert this when it loses focus.
  190. */
  191. width: 103%;
  192. }
  193. .annotationLayer .buttonWidgetAnnotation.checkBox input,
  194. .annotationLayer .buttonWidgetAnnotation.radioButton input {
  195. appearance: none;
  196. }
  197. .annotationLayer .popupTriggerArea {
  198. height: 100%;
  199. width: 100%;
  200. }
  201. .annotationLayer .popupWrapper {
  202. position: absolute;
  203. font-size: calc(9px * var(--scale-factor));
  204. width: 100%;
  205. min-width: calc(180px * var(--scale-factor));
  206. pointer-events: none;
  207. }
  208. .annotationLayer .popup {
  209. position: absolute;
  210. max-width: calc(180px * var(--scale-factor));
  211. background-color: rgba(255, 255, 153, 1);
  212. box-shadow: 0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor))
  213. rgba(136, 136, 136, 1);
  214. border-radius: calc(2px * var(--scale-factor));
  215. padding: calc(6px * var(--scale-factor));
  216. margin-left: calc(5px * var(--scale-factor));
  217. cursor: pointer;
  218. font: message-box;
  219. white-space: normal;
  220. word-wrap: break-word;
  221. pointer-events: auto;
  222. }
  223. .annotationLayer .popup > * {
  224. font-size: calc(9px * var(--scale-factor));
  225. }
  226. .annotationLayer .popup h1 {
  227. display: inline-block;
  228. }
  229. .annotationLayer .popupDate {
  230. display: inline-block;
  231. margin-left: calc(5px * var(--scale-factor));
  232. }
  233. .annotationLayer .popupContent {
  234. border-top: 1px solid rgba(51, 51, 51, 1);
  235. margin-top: calc(2px * var(--scale-factor));
  236. padding-top: calc(2px * var(--scale-factor));
  237. }
  238. .annotationLayer .richText > * {
  239. white-space: pre-wrap;
  240. font-size: calc(9px * var(--scale-factor));
  241. }
  242. .annotationLayer .highlightAnnotation,
  243. .annotationLayer .underlineAnnotation,
  244. .annotationLayer .squigglyAnnotation,
  245. .annotationLayer .strikeoutAnnotation,
  246. .annotationLayer .freeTextAnnotation,
  247. .annotationLayer .lineAnnotation svg line,
  248. .annotationLayer .squareAnnotation svg rect,
  249. .annotationLayer .circleAnnotation svg ellipse,
  250. .annotationLayer .polylineAnnotation svg polyline,
  251. .annotationLayer .polygonAnnotation svg polygon,
  252. .annotationLayer .caretAnnotation,
  253. .annotationLayer .inkAnnotation svg polyline,
  254. .annotationLayer .stampAnnotation,
  255. .annotationLayer .fileAttachmentAnnotation {
  256. cursor: pointer;
  257. }
  258. .annotationLayer section svg {
  259. position: absolute;
  260. width: 100%;
  261. height: 100%;
  262. }
  263. .annotationLayer .annotationTextContent {
  264. position: absolute;
  265. width: 100%;
  266. height: 100%;
  267. opacity: 0;
  268. color: transparent;
  269. user-select: none;
  270. pointer-events: none;
  271. }
  272. .annotationLayer .annotationTextContent span {
  273. width: 100%;
  274. display: inline-block;
  275. }