pdf.less 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  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 {
  294. border-right: 2px solid white;
  295. border-left: 2px solid white;
  296. }
  297. i.fa-arrows-v {
  298. border-top: 2px solid white;
  299. border-bottom: 2px solid white;
  300. }
  301. }
  302. }
  303. // The new viewer UI has overflow on the inner element,
  304. // so disable the overflow on the outer element
  305. .pdf-viewer .pdfjs-viewer.pdfjs-viewer-outer {
  306. overflow: hidden;
  307. }
  308. .pdf-logs {
  309. overflow: auto;
  310. .alert {
  311. font-size: 0.9rem;
  312. margin-bottom: @line-height-computed / 2;
  313. cursor: pointer;
  314. .line-no {
  315. float: right;
  316. color: @log-line-no-color;
  317. font-weight: 700;
  318. .fa {
  319. opacity: 0;
  320. }
  321. }
  322. .entry-message {
  323. font-weight: 700;
  324. //font-family: @font-family-monospace;
  325. }
  326. .entry-content {
  327. white-space: pre-wrap;
  328. font-size: 0.8rem;
  329. //font-family: @font-family-monospace;
  330. }
  331. &:hover .line-no {
  332. color: inherit;
  333. .fa {
  334. opacity: 1;
  335. }
  336. }
  337. &.alert-danger {
  338. background-color: tint(@alert-danger-bg, 15%);
  339. &:hover {
  340. background-color: @alert-danger-bg;
  341. }
  342. }
  343. &.alert-warning {
  344. background-color: tint(@alert-warning-bg, 15%);
  345. &:hover {
  346. background-color: @alert-warning-bg;
  347. }
  348. }
  349. &.alert-info {
  350. background-color: tint(@alert-info-bg, 15%);
  351. &:hover {
  352. background-color: @alert-info-bg;
  353. }
  354. }
  355. }
  356. pre {
  357. font-size: 12px;
  358. white-space: pre-wrap;
  359. }
  360. .dropdown {
  361. position: relative;
  362. }
  363. .force-recompile {
  364. margin-top: 10px;
  365. text-align: right;
  366. }
  367. }
  368. .synctex-controls {
  369. margin-right: -8px;
  370. position: absolute;
  371. z-index: @synctex-controls-z-index;
  372. padding: @synctex-controls-padding;
  373. top: 68px;
  374. }
  375. .synctex-control:not(.detach-synctex-control) {
  376. @ol-synctex-control-size: 24px;
  377. align-items: center;
  378. display: flex;
  379. justify-content: center;
  380. font-size: 1em;
  381. margin-bottom: @ol-synctex-control-size / 2;
  382. width: @ol-synctex-control-size;
  383. height: @ol-synctex-control-size;
  384. border-radius: @ol-synctex-control-size / 2;
  385. padding: 0 0 2px;
  386. background-color: fade(@btn-default-bg, 80%);
  387. transition: background 0.15s ease;
  388. color: white;
  389. border-color: transparent;
  390. &:focus:not(:focus-visible) {
  391. outline: none;
  392. }
  393. &[disabled] {
  394. opacity: 1;
  395. background-color: fade(@btn-default-bg, 60%);
  396. }
  397. }
  398. .synctex-control {
  399. > .synctex-control-icon {
  400. display: inline-block;
  401. font: normal normal normal 14px/1 FontAwesome;
  402. font-size: inherit;
  403. text-rendering: auto;
  404. -webkit-font-smoothing: antialiased;
  405. -moz-osx-font-smoothing: grayscale;
  406. }
  407. > .synctex-spin-icon {
  408. margin-top: 2px;
  409. }
  410. }
  411. .synctex-control-goto-pdf > .synctex-control-icon {
  412. text-indent: 1px; // "Optical" adjustment.
  413. &::before {
  414. content: '\f061';
  415. }
  416. }
  417. .synctex-control-goto-code > .synctex-control-icon {
  418. text-indent: -1px; // "Optical" adjustment.
  419. &::before {
  420. content: '\f060';
  421. }
  422. }
  423. .editor-dark {
  424. .pdf-logs {
  425. background-color: lighten(@editor-dark-background-color, 10%);
  426. }
  427. .pdfjs-viewer {
  428. background-color: lighten(@editor-dark-background-color, 10%);
  429. }
  430. .pdf .toolbar {
  431. .toolbar-right a {
  432. i {
  433. border-color: @gray;
  434. }
  435. &:hover {
  436. i {
  437. border-color: @gray-light;
  438. }
  439. }
  440. }
  441. }
  442. }
  443. .keyboard-tooltip {
  444. .tooltip-inner {
  445. max-width: none;
  446. }
  447. }
  448. .keyboard-shortcut {
  449. white-space: nowrap;
  450. }
  451. @keyframes expand-feedback-area {
  452. from {
  453. max-height: 0;
  454. }
  455. to {
  456. max-height: 500px;
  457. }
  458. }
  459. .card-hint:extend(.card-thin) {
  460. margin-top: 10px;
  461. padding-bottom: 7px;
  462. cursor: default;
  463. &-icon-container {
  464. background: currentColor;
  465. width: 2.5rem;
  466. height: 2.5rem;
  467. font-size: 1.5rem;
  468. text-align: center;
  469. border-radius: 50%;
  470. float: left;
  471. margin-right: 10px;
  472. .fa {
  473. color: #fff;
  474. }
  475. .alert-danger & {
  476. color: @state-danger-border;
  477. }
  478. .alert-warning & {
  479. color: @state-warning-border;
  480. }
  481. .alert-info & {
  482. color: @state-info-border;
  483. }
  484. }
  485. &-text,
  486. &-feedback-label {
  487. color: @log-hints-color;
  488. font-size: 0.9rem;
  489. margin-bottom: 20px;
  490. }
  491. &-text {
  492. min-height: 35px;
  493. }
  494. &-feedback-label {
  495. font-size: inherit;
  496. margin-right: 0.5em;
  497. margin-bottom: 0;
  498. font-weight: normal;
  499. }
  500. &-ext-link,
  501. &-feedback {
  502. display: inline-block;
  503. font-size: 0.8rem;
  504. }
  505. &-footer a,
  506. &-text a {
  507. .alert-danger & {
  508. color: @state-danger-text;
  509. }
  510. .alert-warning & {
  511. color: @state-warning-text;
  512. }
  513. .alert-info & {
  514. color: @state-info-text;
  515. }
  516. }
  517. &-feedback {
  518. color: @log-hints-color;
  519. float: right;
  520. }
  521. &-extra-feedback {
  522. color: @log-hints-color;
  523. font-size: 0.8rem;
  524. margin-top: 10px;
  525. padding-bottom: 5px;
  526. animation: 0.5s ease-out expand-feedback-area;
  527. overflow: hidden;
  528. &-label {
  529. margin: 5px 0 10px;
  530. padding-top: 5px;
  531. border-top: solid 1px @gray-lighter;
  532. }
  533. .radio {
  534. margin: 5px;
  535. }
  536. textarea {
  537. font-size: 0.8rem;
  538. margin-bottom: 10px;
  539. padding: 5px;
  540. }
  541. input[type='radio'] {
  542. margin-top: 2px;
  543. }
  544. }
  545. & + p {
  546. margin-top: 20px;
  547. }
  548. }
  549. .files-dropdown-container {
  550. .pull-right();
  551. position: relative;
  552. }
  553. .files-dropdown {
  554. display: inline-block;
  555. }
  556. .plv-text-layer {
  557. display: none;
  558. user-select: text;
  559. .pdf-page-container:hover &,
  560. .pdfjs-viewer-show-text & {
  561. display: block;
  562. }
  563. }
  564. @editor-and-logs-pane-toolbars-height: @toolbar-small-height + @toolbar-height;
  565. @btn-small-height: (@padding-small-vertical * 2)+ (@font-size-small *
  566. @line-height-small);
  567. #download-dropdown-list,
  568. #dropdown-files-logs-pane-list {
  569. overflow-y: auto;
  570. .dropdown-header {
  571. white-space: nowrap;
  572. }
  573. }
  574. #download-dropdown-list {
  575. max-height: calc(
  576. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @margin-md
  577. );
  578. }
  579. #dropdown-files-logs-pane-list {
  580. max-height: calc(
  581. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @btn-small-height ~' - '
  582. @margin-md
  583. );
  584. }
  585. .pdf-loading-spinner-container {
  586. width: 100%;
  587. height: 100%;
  588. display: flex;
  589. align-items: center;
  590. justify-content: center;
  591. }