pdf.less 12 KB

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