pdf.less 13 KB

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