pdf.less 12 KB

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