pdf.less 12 KB

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