pdf.less 12 KB

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