pdf.less 13 KB

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