pdf.less 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  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. .btn-toggle-logs-label {
  51. padding-left: @line-height-computed / 4;
  52. }
  53. .pdf-toolbar-btn {
  54. display: inline-block;
  55. color: @toolbar-btn-color;
  56. background-color: transparent;
  57. padding: 4px 2px;
  58. line-height: 1;
  59. height: 24px;
  60. border-radius: 2px;
  61. border-radius: @border-radius-base;
  62. &:hover,
  63. &:active,
  64. &:focus {
  65. color: @toolbar-btn-color;
  66. }
  67. &:hover {
  68. &:not(:disabled) {
  69. background-color: @pdf-toolbar-btn-hover-color;
  70. }
  71. }
  72. .label {
  73. position: absolute;
  74. top: 0;
  75. right: 0;
  76. padding: 0.15em 0.6em 0.2em;
  77. font-size: 60%;
  78. pointer-events: none;
  79. }
  80. &.log-btn {
  81. border: none;
  82. margin-right: 3px;
  83. &.active {
  84. color: white;
  85. background-color: @link-color;
  86. box-shadow: @toolbar-icon-btn-hover-boxshadow;
  87. opacity: 0.65;
  88. &:hover {
  89. &:not(:disabled) {
  90. background-color: transparent;
  91. color: @toolbar-btn-color;
  92. }
  93. }
  94. }
  95. &:focus {
  96. outline: none;
  97. }
  98. }
  99. }
  100. .pdf {
  101. background-color: @pdf-bg;
  102. }
  103. .pdf-viewer,
  104. .pdf-logs,
  105. .pdf-errors,
  106. .pdf-uncompiled {
  107. .full-size;
  108. top: @pdf-top-offset;
  109. }
  110. .pdf-logs,
  111. .pdf-errors,
  112. .pdf-uncompiled,
  113. .pdf-validation-problems {
  114. padding: @line-height-computed / 2;
  115. }
  116. .pdf-uncompiled {
  117. .fa {
  118. color: @blue;
  119. }
  120. }
  121. .toolbar-text {
  122. padding-left: @padding-xs;
  123. }
  124. .pdf-viewer {
  125. iframe {
  126. width: 100%;
  127. height: 100%;
  128. border: none;
  129. }
  130. .pdfjs-viewer {
  131. .full-size;
  132. background-color: @pdfjs-bg;
  133. overflow: scroll;
  134. .canvasWrapper > canvas,
  135. div.pdf-canvas {
  136. background: white;
  137. box-shadow: @pdf-page-shadow-color 0px 0px 10px;
  138. }
  139. div.pdf-canvas.pdfng-empty {
  140. background-color: white;
  141. }
  142. div.pdf-canvas.pdfng-loading {
  143. background-color: white;
  144. }
  145. .page-container {
  146. margin: 10px auto;
  147. padding: 0 10px;
  148. box-sizing: content-box;
  149. user-select: none;
  150. }
  151. .page {
  152. box-sizing: content-box;
  153. margin-left: auto;
  154. margin-right: auto;
  155. box-shadow: 0 0 8px #bbb;
  156. border: none;
  157. margin-top: 10px;
  158. margin-bottom: 10px;
  159. }
  160. .pdfjs-viewer-inner {
  161. position: absolute;
  162. overflow-y: scroll;
  163. width: 100%;
  164. height: 100%;
  165. -webkit-font-smoothing: initial;
  166. -moz-osx-font-smoothing: initial;
  167. /* fix review-panel overflow issue, see: https://github.com/overleaf/internal/issues/6781#issuecomment-1112708638 */
  168. .pdfViewer {
  169. min-height: 100%;
  170. }
  171. }
  172. &:focus-within {
  173. outline: none;
  174. }
  175. /* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */
  176. .textLayer br::selection {
  177. background: transparent;
  178. }
  179. }
  180. .progress-thin {
  181. position: absolute;
  182. top: -2px;
  183. height: 3px;
  184. left: 0;
  185. right: 0;
  186. .progress-bar {
  187. height: 100%;
  188. background-color: @link-color;
  189. }
  190. }
  191. }
  192. // TODO: remove this block once the new pdfjs toolbar is fully rolled out
  193. .pdfjs-controls {
  194. position: absolute;
  195. padding: @line-height-computed / 2;
  196. top: 0;
  197. left: 0;
  198. display: inline-block;
  199. z-index: 10; // above the PDF viewer
  200. .btn-group {
  201. transition:
  202. opacity 0.5s ease,
  203. visibility 0 linear 0.5s;
  204. visibility: hidden;
  205. opacity: 0;
  206. }
  207. &:focus-within,
  208. &:hover {
  209. // make .pdfjs-controls and its children visible when it or any of its descendants are focused
  210. .btn-group {
  211. transition: none;
  212. visibility: visible;
  213. opacity: 1;
  214. }
  215. }
  216. &:hover,
  217. &.flash {
  218. .btn-group {
  219. transition: none;
  220. visibility: visible;
  221. opacity: 1;
  222. }
  223. }
  224. i.fa-arrows-h {
  225. border-right: 2px solid @content-primary;
  226. border-left: 2px solid @content-primary;
  227. }
  228. i.fa-arrows-v {
  229. border-top: 2px solid @content-primary;
  230. border-bottom: 2px solid @content-primary;
  231. }
  232. }
  233. .pdfjs-viewer-controls {
  234. display: flex;
  235. align-items: center;
  236. justify-content: flex-end;
  237. width: 100%;
  238. }
  239. .pdfjs-zoom-controls {
  240. border-left: 1px solid rgba(125, 125, 125, 0.3);
  241. }
  242. .pdfjs-toolbar-buttons {
  243. display: flex;
  244. gap: 8px;
  245. margin-left: 8px;
  246. margin-right: 8px;
  247. }
  248. .pdfjs-toolbar-button {
  249. padding: 2px !important;
  250. display: flex;
  251. align-items: center;
  252. &:hover {
  253. color: @toolbar-btn-color;
  254. }
  255. }
  256. .pdfjs-zoom-dropdown-button {
  257. width: 60px;
  258. text-align: right;
  259. font-size: 14px;
  260. font-weight: normal;
  261. .caret {
  262. margin-left: 4px;
  263. }
  264. }
  265. .pdfjs-zoom-dropdown-mac-shortcut-char {
  266. display: inline-block;
  267. width: 1em;
  268. text-align: center;
  269. }
  270. .pdfjs-custom-zoom-menu-item {
  271. a:hover {
  272. background-color: initial !important;
  273. color: initial !important;
  274. cursor: initial !important;
  275. }
  276. &.disabled {
  277. a {
  278. color: initial !important;
  279. }
  280. }
  281. }
  282. .pdfjs-page-number-input {
  283. color: @toolbar-btn-color;
  284. font-size: 14px;
  285. padding: 8px 8px 8px 0;
  286. display: flex;
  287. align-items: center;
  288. gap: 4px;
  289. input {
  290. color: initial;
  291. border: 1px solid @neutral-60;
  292. width: 32px;
  293. height: 24px;
  294. border-radius: @border-radius-base;
  295. text-align: center;
  296. }
  297. }
  298. .pdfjs-viewer-controls-small {
  299. display: flex;
  300. align-items: center;
  301. gap: 8px;
  302. }
  303. .pdfjs-toolbar-popover-button {
  304. padding: 2px !important;
  305. display: flex;
  306. align-items: center;
  307. }
  308. .pdfjs-toolbar-popover {
  309. background-color: @editor-toolbar-bg;
  310. border-radius: 4px;
  311. .arrow {
  312. display: none;
  313. }
  314. button {
  315. background-color: transparent;
  316. color: @toolbar-btn-color;
  317. }
  318. .popover-content {
  319. display: flex;
  320. align-items: center;
  321. padding: 0;
  322. }
  323. }
  324. // The new viewer UI has overflow on the inner element,
  325. // so disable the overflow on the outer element
  326. .pdf-viewer .pdfjs-viewer.pdfjs-viewer-outer {
  327. overflow: hidden;
  328. }
  329. :fullscreen {
  330. .pdfjs-viewer-inner {
  331. overflow-y: hidden !important;
  332. }
  333. }
  334. .pdf-logs {
  335. overflow: auto;
  336. .alert {
  337. font-size: 0.9rem;
  338. margin-bottom: @line-height-computed / 2;
  339. cursor: pointer;
  340. .line-no {
  341. float: right;
  342. color: @log-line-no-color;
  343. font-weight: 700;
  344. .fa {
  345. opacity: 0;
  346. }
  347. }
  348. .entry-message {
  349. font-weight: 700;
  350. //font-family: @font-family-monospace;
  351. }
  352. .entry-content {
  353. white-space: pre-wrap;
  354. font-size: 0.8rem;
  355. //font-family: @font-family-monospace;
  356. }
  357. &:hover .line-no {
  358. color: inherit;
  359. .fa {
  360. opacity: 1;
  361. }
  362. }
  363. &.alert-danger {
  364. background-color: tint(@alert-danger-bg, 15%);
  365. &:hover {
  366. background-color: @alert-danger-bg;
  367. }
  368. }
  369. &.alert-warning {
  370. background-color: tint(@alert-warning-bg, 15%);
  371. &:hover {
  372. background-color: @alert-warning-bg;
  373. }
  374. }
  375. &.alert-info {
  376. background-color: tint(@alert-info-bg, 15%);
  377. &:hover {
  378. background-color: @alert-info-bg;
  379. }
  380. }
  381. }
  382. pre {
  383. font-size: 12px;
  384. white-space: pre-wrap;
  385. }
  386. .dropdown {
  387. position: relative;
  388. }
  389. .force-recompile {
  390. margin-top: 10px;
  391. text-align: right;
  392. }
  393. }
  394. .synctex-controls {
  395. margin-right: -8px;
  396. position: absolute;
  397. z-index: @synctex-controls-z-index;
  398. padding: @synctex-controls-padding;
  399. top: 68px;
  400. }
  401. .synctex-control:not(.detach-synctex-control) {
  402. @ol-synctex-control-size: 24px;
  403. align-items: center;
  404. display: flex;
  405. justify-content: center;
  406. font-size: 1em;
  407. margin-bottom: @ol-synctex-control-size / 2;
  408. width: @ol-synctex-control-size;
  409. height: @ol-synctex-control-size;
  410. border-radius: @ol-synctex-control-size / 2;
  411. padding: 0 0 2px;
  412. background-color: fade(@btn-default-bg, 80%);
  413. transition: background 0.15s ease;
  414. color: white;
  415. border-color: transparent;
  416. &:focus:not(:focus-visible) {
  417. outline: none;
  418. }
  419. &[disabled] {
  420. opacity: 1;
  421. background-color: fade(@btn-default-bg, 60%);
  422. }
  423. }
  424. .synctex-control {
  425. > .synctex-control-icon {
  426. display: inline-block;
  427. font: normal normal normal 14px/1 FontAwesome;
  428. font-size: inherit;
  429. text-rendering: auto;
  430. -webkit-font-smoothing: antialiased;
  431. -moz-osx-font-smoothing: grayscale;
  432. }
  433. > .synctex-spin-icon {
  434. margin-top: 2px;
  435. }
  436. }
  437. .synctex-control-goto-pdf > .synctex-control-icon {
  438. text-indent: 1px; // "Optical" adjustment.
  439. &::before {
  440. content: '\f061';
  441. }
  442. }
  443. .synctex-control-goto-code > .synctex-control-icon {
  444. text-indent: -1px; // "Optical" adjustment.
  445. &::before {
  446. content: '\f060';
  447. }
  448. }
  449. .editor-dark {
  450. .pdf-logs {
  451. background-color: lighten(@editor-dark-background-color, 10%);
  452. }
  453. .pdfjs-viewer {
  454. background-color: lighten(@editor-dark-background-color, 10%);
  455. }
  456. .pdf .toolbar {
  457. .toolbar-right a {
  458. i {
  459. border-color: @gray;
  460. }
  461. &:hover {
  462. i {
  463. border-color: @gray-light;
  464. }
  465. }
  466. }
  467. }
  468. }
  469. .keyboard-tooltip {
  470. .tooltip-inner {
  471. max-width: none;
  472. }
  473. }
  474. .keyboard-shortcut {
  475. white-space: nowrap;
  476. }
  477. @keyframes expand-feedback-area {
  478. from {
  479. max-height: 0;
  480. }
  481. to {
  482. max-height: 500px;
  483. }
  484. }
  485. .card-hint:extend(.card-thin) {
  486. margin-top: 10px;
  487. padding-bottom: 7px;
  488. cursor: default;
  489. &-icon-container {
  490. background: currentColor;
  491. width: 2.5rem;
  492. height: 2.5rem;
  493. font-size: 1.5rem;
  494. text-align: center;
  495. border-radius: 50%;
  496. float: left;
  497. margin-right: 10px;
  498. .fa {
  499. color: #fff;
  500. }
  501. .alert-danger & {
  502. color: @state-danger-border;
  503. }
  504. .alert-warning & {
  505. color: @state-warning-border;
  506. }
  507. .alert-info & {
  508. color: @state-info-border;
  509. }
  510. }
  511. &-text,
  512. &-feedback-label {
  513. color: @log-hints-color;
  514. font-size: 0.9rem;
  515. margin-bottom: 20px;
  516. }
  517. &-text {
  518. min-height: 35px;
  519. }
  520. &-feedback-label {
  521. font-size: inherit;
  522. margin-right: 0.5em;
  523. margin-bottom: 0;
  524. font-weight: normal;
  525. }
  526. &-ext-link,
  527. &-feedback {
  528. display: inline-block;
  529. font-size: 0.8rem;
  530. }
  531. &-footer a,
  532. &-text a {
  533. .alert-danger & {
  534. color: @state-danger-text;
  535. }
  536. .alert-warning & {
  537. color: @state-warning-text;
  538. }
  539. .alert-info & {
  540. color: @state-info-text;
  541. }
  542. }
  543. &-feedback {
  544. color: @log-hints-color;
  545. float: right;
  546. }
  547. &-extra-feedback {
  548. color: @log-hints-color;
  549. font-size: 0.8rem;
  550. margin-top: 10px;
  551. padding-bottom: 5px;
  552. animation: 0.5s ease-out expand-feedback-area;
  553. overflow: hidden;
  554. &-label {
  555. margin: 5px 0 10px;
  556. padding-top: 5px;
  557. border-top: solid 1px @gray-lighter;
  558. }
  559. .radio {
  560. margin: 5px;
  561. }
  562. textarea {
  563. font-size: 0.8rem;
  564. margin-bottom: 10px;
  565. padding: 5px;
  566. }
  567. input[type='radio'] {
  568. margin-top: 2px;
  569. }
  570. }
  571. & + p {
  572. margin-top: 20px;
  573. }
  574. }
  575. .files-dropdown-container {
  576. .pull-right();
  577. position: relative;
  578. }
  579. .files-dropdown {
  580. display: inline-block;
  581. }
  582. @editor-and-logs-pane-toolbars-height: @toolbar-small-height + @toolbar-height;
  583. @btn-small-height: (@padding-small-vertical * 2)+ (@font-size-small *
  584. @line-height-small);
  585. #download-dropdown-list,
  586. #dropdown-files-logs-pane-list {
  587. overflow-y: auto;
  588. .dropdown-header {
  589. white-space: nowrap;
  590. }
  591. }
  592. #download-dropdown-list {
  593. max-height: calc(
  594. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @margin-md
  595. );
  596. }
  597. #dropdown-files-logs-pane-list {
  598. max-height: calc(
  599. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @btn-small-height ~' - '
  600. @margin-md
  601. );
  602. }
  603. .btn-secondary-compile-timeout-override {
  604. color: #1b222c;
  605. background-color: #ffffff;
  606. border-color: #677283;
  607. border-width: 1px;
  608. }