pdf.less 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. .pdf .toolbar.toolbar-pdf {
  2. .toolbar-small-mixin;
  3. .toolbar-alt-mixin;
  4. padding-right: 5px;
  5. margin-left: 0;
  6. .auto-compile-status {
  7. color: white;
  8. margin-right: (@line-height-computed / 2);
  9. i {
  10. color: @brand-danger;
  11. }
  12. }
  13. .auto-compile-status when (@is-overleaf-light = true) {
  14. color: @ol-blue-gray-3;
  15. }
  16. }
  17. .toolbar-pdf-orphan,
  18. .toolbar-pdf-left,
  19. .toolbar-pdf-right,
  20. .toolbar-pdf-controls {
  21. display: flex;
  22. align-items: center;
  23. align-self: stretch;
  24. }
  25. .toolbar-pdf-orphan,
  26. .toolbar-pdf-controls {
  27. flex: 1 1 100%;
  28. }
  29. .toolbar-pdf-controls {
  30. margin-right: 4px;
  31. justify-content: flex-end;
  32. }
  33. .toolbar-pdf-right {
  34. flex: 1;
  35. justify-content: flex-end;
  36. }
  37. .toolbar-pdf-orphan {
  38. justify-content: center;
  39. color: @toolbar-btn-color;
  40. .btn {
  41. margin-left: @margin-xs;
  42. }
  43. }
  44. .btn-toggle-logs {
  45. &:focus,
  46. &:active:focus {
  47. outline: none;
  48. }
  49. }
  50. .pdf-toolbar-btn {
  51. display: inline-block;
  52. color: @toolbar-btn-color;
  53. background-color: transparent;
  54. padding: 4px 2px;
  55. line-height: 1;
  56. height: 24px;
  57. border-radius: @border-radius-base;
  58. &:hover,
  59. &:active,
  60. &:focus {
  61. color: @toolbar-btn-color;
  62. }
  63. &:hover {
  64. &:not(:disabled) {
  65. background-color: @pdf-toolbar-btn-hover-color;
  66. }
  67. }
  68. .label {
  69. position: absolute;
  70. top: 0;
  71. right: 0;
  72. padding: 0.15em 0.6em 0.2em;
  73. font-size: 60%;
  74. pointer-events: none;
  75. }
  76. &.log-btn {
  77. border: none;
  78. margin-right: 3px;
  79. &.active {
  80. color: white;
  81. background-color: @link-color;
  82. box-shadow: @toolbar-icon-btn-hover-boxshadow;
  83. opacity: 0.65;
  84. &:hover {
  85. &:not(:disabled) {
  86. background-color: transparent;
  87. color: @toolbar-btn-color;
  88. }
  89. }
  90. }
  91. &:focus {
  92. outline: none;
  93. }
  94. }
  95. }
  96. .pdf {
  97. background-color: @pdf-bg;
  98. }
  99. .pdf-viewer,
  100. .pdf-errors,
  101. .pdf-uncompiled {
  102. .full-size;
  103. top: @pdf-top-offset;
  104. }
  105. .pdf-errors,
  106. .pdf-uncompiled,
  107. .pdf-validation-problems {
  108. padding: @line-height-computed / 2;
  109. }
  110. .pdf-uncompiled {
  111. .fa {
  112. color: @blue;
  113. }
  114. }
  115. .toolbar-text {
  116. padding-left: @padding-xs;
  117. }
  118. .pdf-viewer {
  119. iframe {
  120. width: 100%;
  121. height: 100%;
  122. border: none;
  123. }
  124. .pdfjs-viewer {
  125. .full-size;
  126. background-color: @pdfjs-bg;
  127. overflow: scroll;
  128. .canvasWrapper > canvas,
  129. div.pdf-canvas {
  130. background: white;
  131. box-shadow: @pdf-page-shadow-color 0px 0px 10px;
  132. }
  133. div.pdf-canvas.pdfng-empty {
  134. background-color: white;
  135. }
  136. div.pdf-canvas.pdfng-loading {
  137. background-color: white;
  138. }
  139. .page-container {
  140. margin: 10px auto;
  141. padding: 0 10px;
  142. box-sizing: content-box;
  143. user-select: none;
  144. }
  145. .page {
  146. box-sizing: content-box;
  147. margin-left: auto;
  148. margin-right: auto;
  149. box-shadow: 0 0 8px #bbb;
  150. border: none;
  151. margin-top: 10px;
  152. margin-bottom: 10px;
  153. }
  154. .pdfjs-viewer-inner {
  155. position: absolute;
  156. overflow-y: scroll;
  157. width: 100%;
  158. height: 100%;
  159. -webkit-font-smoothing: initial;
  160. -moz-osx-font-smoothing: initial;
  161. /* fix review-panel overflow issue, see: https://github.com/overleaf/internal/issues/6781#issuecomment-1112708638 */
  162. .pdfViewer {
  163. min-height: 100%;
  164. }
  165. }
  166. &:focus-within {
  167. outline: none;
  168. }
  169. /* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */
  170. .textLayer br::selection {
  171. background: transparent;
  172. }
  173. }
  174. .progress-thin {
  175. position: absolute;
  176. top: -2px;
  177. height: 3px;
  178. left: 0;
  179. right: 0;
  180. .progress-bar {
  181. height: 100%;
  182. background-color: @link-color;
  183. }
  184. }
  185. }
  186. .pdfjs-viewer-controls {
  187. display: flex;
  188. align-items: center;
  189. justify-content: flex-end;
  190. width: 100%;
  191. }
  192. .pdfjs-zoom-controls {
  193. border-left: 1px solid rgba(125, 125, 125, 0.3);
  194. }
  195. .pdfjs-toolbar-buttons {
  196. display: flex;
  197. gap: 8px;
  198. margin-left: 8px;
  199. margin-right: 8px;
  200. }
  201. .pdfjs-toolbar-button {
  202. padding: 2px !important;
  203. display: flex;
  204. align-items: center;
  205. &:hover {
  206. color: @toolbar-btn-color;
  207. }
  208. }
  209. .pdfjs-zoom-dropdown-button {
  210. width: 60px;
  211. text-align: right;
  212. font-size: 14px;
  213. font-weight: normal;
  214. .caret {
  215. margin-left: 4px;
  216. }
  217. }
  218. .pdfjs-zoom-dropdown-mac-shortcut-char {
  219. display: inline-block;
  220. width: 1em;
  221. text-align: center;
  222. }
  223. .pdfjs-custom-zoom-menu-item {
  224. a:hover {
  225. background-color: initial !important;
  226. color: initial !important;
  227. cursor: initial !important;
  228. }
  229. &.disabled {
  230. a {
  231. color: initial !important;
  232. }
  233. }
  234. }
  235. .pdfjs-page-number-input {
  236. color: @toolbar-btn-color;
  237. font-size: 14px;
  238. padding: 8px 8px 8px 0;
  239. display: flex;
  240. align-items: center;
  241. gap: 4px;
  242. input {
  243. color: initial;
  244. border: 1px solid @neutral-60;
  245. width: 32px;
  246. height: 24px;
  247. border-radius: @border-radius-base;
  248. text-align: center;
  249. }
  250. }
  251. .pdfjs-viewer-controls-small {
  252. display: flex;
  253. align-items: center;
  254. gap: 8px;
  255. }
  256. .pdfjs-toolbar-popover-button {
  257. padding: 2px !important;
  258. display: flex;
  259. align-items: center;
  260. }
  261. .pdfjs-toolbar-popover {
  262. background-color: @editor-toolbar-bg;
  263. border-radius: 4px;
  264. .arrow {
  265. display: none;
  266. }
  267. button {
  268. background-color: transparent;
  269. color: @toolbar-btn-color;
  270. }
  271. .popover-content {
  272. display: flex;
  273. align-items: center;
  274. padding: 0;
  275. }
  276. }
  277. // The new viewer UI has overflow on the inner element,
  278. // so disable the overflow on the outer element
  279. .pdf-viewer .pdfjs-viewer.pdfjs-viewer-outer {
  280. overflow: hidden;
  281. }
  282. :fullscreen {
  283. .pdfViewer {
  284. min-height: auto !important;
  285. }
  286. .pdfjs-viewer-inner {
  287. overflow-y: hidden !important;
  288. display: flex;
  289. align-items: center;
  290. justify-content: center;
  291. }
  292. }
  293. .synctex-controls {
  294. margin-right: -8px;
  295. position: absolute;
  296. z-index: @synctex-controls-z-index;
  297. padding: @synctex-controls-padding;
  298. top: 68px;
  299. }
  300. .synctex-control:not(.detach-synctex-control) {
  301. @ol-synctex-control-size: 24px;
  302. align-items: center;
  303. display: flex;
  304. justify-content: center;
  305. font-size: 1em;
  306. margin-bottom: @ol-synctex-control-size / 2;
  307. width: @ol-synctex-control-size;
  308. height: @ol-synctex-control-size;
  309. border-radius: @ol-synctex-control-size / 2;
  310. padding: 0 0 2px;
  311. background-color: fade(@btn-default-bg, 80%);
  312. transition: background 0.15s ease;
  313. color: white;
  314. border-color: transparent;
  315. &:focus:not(:focus-visible) {
  316. outline: none;
  317. }
  318. &[disabled] {
  319. opacity: 1;
  320. background-color: fade(@btn-default-bg, 60%);
  321. }
  322. }
  323. .synctex-control {
  324. > .synctex-control-icon {
  325. display: inline-block;
  326. font: normal normal normal 14px/1 FontAwesome;
  327. font-size: inherit;
  328. text-rendering: auto;
  329. -webkit-font-smoothing: antialiased;
  330. -moz-osx-font-smoothing: grayscale;
  331. }
  332. > .synctex-spin-icon {
  333. margin-top: 2px;
  334. }
  335. }
  336. .editor-dark {
  337. .pdfjs-viewer {
  338. background-color: lighten(@editor-dark-background-color, 10%);
  339. }
  340. .pdf .toolbar {
  341. .toolbar-right a {
  342. i {
  343. border-color: @gray;
  344. }
  345. &:hover {
  346. i {
  347. border-color: @gray-light;
  348. }
  349. }
  350. }
  351. }
  352. }
  353. .keyboard-tooltip {
  354. .tooltip-inner {
  355. max-width: none;
  356. }
  357. }
  358. .keyboard-shortcut {
  359. white-space: nowrap;
  360. }
  361. @keyframes expand-feedback-area {
  362. from {
  363. max-height: 0;
  364. }
  365. to {
  366. max-height: 500px;
  367. }
  368. }
  369. .card-hint:extend(.card-thin) {
  370. margin-top: 10px;
  371. padding-bottom: 7px;
  372. cursor: default;
  373. &-icon-container {
  374. background: currentColor;
  375. width: 2.5rem;
  376. height: 2.5rem;
  377. font-size: 1.5rem;
  378. text-align: center;
  379. border-radius: 50%;
  380. float: left;
  381. margin-right: 10px;
  382. .fa {
  383. color: #fff;
  384. }
  385. .alert-danger & {
  386. color: @state-danger-border;
  387. }
  388. .alert-warning & {
  389. color: @state-warning-border;
  390. }
  391. .alert-info & {
  392. color: @state-info-border;
  393. }
  394. }
  395. &-text,
  396. &-feedback-label {
  397. color: @log-hints-color;
  398. font-size: 0.9rem;
  399. margin-bottom: 20px;
  400. }
  401. &-text {
  402. min-height: 35px;
  403. }
  404. &-feedback-label {
  405. font-size: inherit;
  406. margin-right: 0.5em;
  407. margin-bottom: 0;
  408. font-weight: normal;
  409. }
  410. &-ext-link,
  411. &-feedback {
  412. display: inline-block;
  413. font-size: 0.8rem;
  414. }
  415. &-footer a,
  416. &-text a {
  417. .alert-danger & {
  418. color: @state-danger-text;
  419. }
  420. .alert-warning & {
  421. color: @state-warning-text;
  422. }
  423. .alert-info & {
  424. color: @state-info-text;
  425. }
  426. }
  427. &-feedback {
  428. color: @log-hints-color;
  429. float: right;
  430. }
  431. &-extra-feedback {
  432. color: @log-hints-color;
  433. font-size: 0.8rem;
  434. margin-top: 10px;
  435. padding-bottom: 5px;
  436. animation: 0.5s ease-out expand-feedback-area;
  437. overflow: hidden;
  438. &-label {
  439. margin: 5px 0 10px;
  440. padding-top: 5px;
  441. border-top: solid 1px @gray-lighter;
  442. }
  443. .radio {
  444. margin: 5px;
  445. }
  446. textarea {
  447. font-size: 0.8rem;
  448. margin-bottom: 10px;
  449. padding: 5px;
  450. }
  451. input[type='radio'] {
  452. margin-top: 2px;
  453. }
  454. }
  455. & + p {
  456. margin-top: 20px;
  457. }
  458. }
  459. .files-dropdown-container {
  460. .pull-right();
  461. position: relative;
  462. }
  463. .files-dropdown {
  464. display: inline-block;
  465. }
  466. @editor-and-logs-pane-toolbars-height: @toolbar-small-height + @toolbar-height;
  467. @btn-small-height: (@padding-small-vertical * 2)+
  468. (@font-size-small * @line-height-small); // 5px * 2 + 14px * 1.5 = 31px
  469. #dropdown-files-logs-pane-list {
  470. overflow-y: auto;
  471. .dropdown-header {
  472. white-space: nowrap;
  473. }
  474. max-height: calc(
  475. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @btn-small-height
  476. ~' - ' @margin-md
  477. );
  478. }