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. .pdfjs-viewer-inner {
  284. overflow-y: hidden !important;
  285. }
  286. }
  287. .synctex-controls {
  288. margin-right: -8px;
  289. position: absolute;
  290. z-index: @synctex-controls-z-index;
  291. padding: @synctex-controls-padding;
  292. top: 68px;
  293. }
  294. .synctex-control:not(.detach-synctex-control) {
  295. @ol-synctex-control-size: 24px;
  296. align-items: center;
  297. display: flex;
  298. justify-content: center;
  299. font-size: 1em;
  300. margin-bottom: @ol-synctex-control-size / 2;
  301. width: @ol-synctex-control-size;
  302. height: @ol-synctex-control-size;
  303. border-radius: @ol-synctex-control-size / 2;
  304. padding: 0 0 2px;
  305. background-color: fade(@btn-default-bg, 80%);
  306. transition: background 0.15s ease;
  307. color: white;
  308. border-color: transparent;
  309. &:focus:not(:focus-visible) {
  310. outline: none;
  311. }
  312. &[disabled] {
  313. opacity: 1;
  314. background-color: fade(@btn-default-bg, 60%);
  315. }
  316. }
  317. .synctex-control {
  318. > .synctex-control-icon {
  319. display: inline-block;
  320. font: normal normal normal 14px/1 FontAwesome;
  321. font-size: inherit;
  322. text-rendering: auto;
  323. -webkit-font-smoothing: antialiased;
  324. -moz-osx-font-smoothing: grayscale;
  325. }
  326. > .synctex-spin-icon {
  327. margin-top: 2px;
  328. }
  329. }
  330. .editor-dark {
  331. .pdfjs-viewer {
  332. background-color: lighten(@editor-dark-background-color, 10%);
  333. }
  334. .pdf .toolbar {
  335. .toolbar-right a {
  336. i {
  337. border-color: @gray;
  338. }
  339. &:hover {
  340. i {
  341. border-color: @gray-light;
  342. }
  343. }
  344. }
  345. }
  346. }
  347. .keyboard-tooltip {
  348. .tooltip-inner {
  349. max-width: none;
  350. }
  351. }
  352. .keyboard-shortcut {
  353. white-space: nowrap;
  354. }
  355. @keyframes expand-feedback-area {
  356. from {
  357. max-height: 0;
  358. }
  359. to {
  360. max-height: 500px;
  361. }
  362. }
  363. .card-hint:extend(.card-thin) {
  364. margin-top: 10px;
  365. padding-bottom: 7px;
  366. cursor: default;
  367. &-icon-container {
  368. background: currentColor;
  369. width: 2.5rem;
  370. height: 2.5rem;
  371. font-size: 1.5rem;
  372. text-align: center;
  373. border-radius: 50%;
  374. float: left;
  375. margin-right: 10px;
  376. .fa {
  377. color: #fff;
  378. }
  379. .alert-danger & {
  380. color: @state-danger-border;
  381. }
  382. .alert-warning & {
  383. color: @state-warning-border;
  384. }
  385. .alert-info & {
  386. color: @state-info-border;
  387. }
  388. }
  389. &-text,
  390. &-feedback-label {
  391. color: @log-hints-color;
  392. font-size: 0.9rem;
  393. margin-bottom: 20px;
  394. }
  395. &-text {
  396. min-height: 35px;
  397. }
  398. &-feedback-label {
  399. font-size: inherit;
  400. margin-right: 0.5em;
  401. margin-bottom: 0;
  402. font-weight: normal;
  403. }
  404. &-ext-link,
  405. &-feedback {
  406. display: inline-block;
  407. font-size: 0.8rem;
  408. }
  409. &-footer a,
  410. &-text a {
  411. .alert-danger & {
  412. color: @state-danger-text;
  413. }
  414. .alert-warning & {
  415. color: @state-warning-text;
  416. }
  417. .alert-info & {
  418. color: @state-info-text;
  419. }
  420. }
  421. &-feedback {
  422. color: @log-hints-color;
  423. float: right;
  424. }
  425. &-extra-feedback {
  426. color: @log-hints-color;
  427. font-size: 0.8rem;
  428. margin-top: 10px;
  429. padding-bottom: 5px;
  430. animation: 0.5s ease-out expand-feedback-area;
  431. overflow: hidden;
  432. &-label {
  433. margin: 5px 0 10px;
  434. padding-top: 5px;
  435. border-top: solid 1px @gray-lighter;
  436. }
  437. .radio {
  438. margin: 5px;
  439. }
  440. textarea {
  441. font-size: 0.8rem;
  442. margin-bottom: 10px;
  443. padding: 5px;
  444. }
  445. input[type='radio'] {
  446. margin-top: 2px;
  447. }
  448. }
  449. & + p {
  450. margin-top: 20px;
  451. }
  452. }
  453. .files-dropdown-container {
  454. .pull-right();
  455. position: relative;
  456. }
  457. .files-dropdown {
  458. display: inline-block;
  459. }
  460. @editor-and-logs-pane-toolbars-height: @toolbar-small-height + @toolbar-height;
  461. @btn-small-height: (@padding-small-vertical * 2)+ (@font-size-small *
  462. @line-height-small); // 5px * 2 + 14px * 1.5 = 31px
  463. #dropdown-files-logs-pane-list {
  464. overflow-y: auto;
  465. .dropdown-header {
  466. white-space: nowrap;
  467. }
  468. max-height: calc(
  469. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @btn-small-height ~' - '
  470. @margin-md
  471. );
  472. }
  473. .btn-secondary-compile-timeout-override {
  474. color: #1b222c;
  475. background-color: #ffffff;
  476. border-color: #677283;
  477. border-width: 1px;
  478. }