pdf.less 11 KB

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