pdf.less 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  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: white;
  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) {
  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 {
  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. > .synctex-control-icon {
  348. display: inline-block;
  349. font: normal normal normal 14px/1 FontAwesome;
  350. font-size: inherit;
  351. text-rendering: auto;
  352. -webkit-font-smoothing: antialiased;
  353. -moz-osx-font-smoothing: grayscale;
  354. }
  355. > .synctex-spin-icon {
  356. margin-top: 2px;
  357. }
  358. }
  359. .synctex-control-goto-pdf > .synctex-control-icon {
  360. text-indent: 1px; // "Optical" adjustment.
  361. &::before {
  362. content: '\f061';
  363. }
  364. }
  365. .synctex-control-goto-code > .synctex-control-icon {
  366. text-indent: -1px; // "Optical" adjustment.
  367. &::before {
  368. content: '\f060';
  369. }
  370. }
  371. .editor-dark {
  372. .pdf-logs {
  373. background-color: lighten(@editor-dark-background-color, 10%);
  374. }
  375. .pdfjs-viewer {
  376. background-color: lighten(@editor-dark-background-color, 10%);
  377. }
  378. .pdf .toolbar {
  379. .toolbar-right a {
  380. i {
  381. border-color: @gray;
  382. }
  383. &:hover {
  384. i {
  385. border-color: @gray-light;
  386. }
  387. }
  388. }
  389. }
  390. }
  391. .keyboard-tooltip {
  392. .tooltip-inner {
  393. max-width: none;
  394. }
  395. }
  396. .keyboard-shortcut {
  397. white-space: nowrap;
  398. }
  399. @keyframes expand-feedback-area {
  400. from {
  401. max-height: 0;
  402. }
  403. to {
  404. max-height: 500px;
  405. }
  406. }
  407. .card-hint:extend(.card-thin) {
  408. margin-top: 10px;
  409. padding-bottom: 7px;
  410. cursor: default;
  411. &-icon-container {
  412. background: currentColor;
  413. width: 2.5rem;
  414. height: 2.5rem;
  415. font-size: 1.5rem;
  416. text-align: center;
  417. border-radius: 50%;
  418. float: left;
  419. margin-right: 10px;
  420. .fa {
  421. color: #fff;
  422. }
  423. .alert-danger & {
  424. color: @state-danger-border;
  425. }
  426. .alert-warning & {
  427. color: @state-warning-border;
  428. }
  429. .alert-info & {
  430. color: @state-info-border;
  431. }
  432. }
  433. &-text,
  434. &-feedback-label {
  435. color: @log-hints-color;
  436. font-size: 0.9rem;
  437. margin-bottom: 20px;
  438. }
  439. &-text {
  440. min-height: 35px;
  441. }
  442. &-feedback-label {
  443. font-size: inherit;
  444. margin-right: 0.5em;
  445. margin-bottom: 0;
  446. font-weight: normal;
  447. }
  448. &-ext-link,
  449. &-feedback {
  450. display: inline-block;
  451. font-size: 0.8rem;
  452. }
  453. &-footer a,
  454. &-text a {
  455. .alert-danger & {
  456. color: @state-danger-text;
  457. }
  458. .alert-warning & {
  459. color: @state-warning-text;
  460. }
  461. .alert-info & {
  462. color: @state-info-text;
  463. }
  464. }
  465. &-feedback {
  466. color: @log-hints-color;
  467. float: right;
  468. }
  469. &-extra-feedback {
  470. color: @log-hints-color;
  471. font-size: 0.8rem;
  472. margin-top: 10px;
  473. padding-bottom: 5px;
  474. animation: 0.5s ease-out expand-feedback-area;
  475. overflow: hidden;
  476. &-label {
  477. margin: 5px 0 10px;
  478. padding-top: 5px;
  479. border-top: solid 1px @gray-lighter;
  480. }
  481. .radio {
  482. margin: 5px;
  483. }
  484. textarea {
  485. font-size: 0.8rem;
  486. margin-bottom: 10px;
  487. padding: 5px;
  488. }
  489. input[type='radio'] {
  490. margin-top: 2px;
  491. }
  492. }
  493. & + p {
  494. margin-top: 20px;
  495. }
  496. }
  497. .files-dropdown-container {
  498. .pull-right();
  499. position: relative;
  500. }
  501. .files-dropdown {
  502. display: inline-block;
  503. }
  504. .plv-text-layer {
  505. display: none;
  506. user-select: text;
  507. .pdf-page-container:hover &,
  508. .pdfjs-viewer-show-text & {
  509. display: block;
  510. }
  511. }
  512. @editor-and-logs-pane-toolbars-height: @toolbar-small-height + @toolbar-height;
  513. @btn-small-height: (@padding-small-vertical * 2)+ (@font-size-small *
  514. @line-height-small);
  515. #download-dropdown-list,
  516. #dropdown-files-logs-pane-list {
  517. overflow-y: auto;
  518. .dropdown-header {
  519. white-space: nowrap;
  520. }
  521. }
  522. #download-dropdown-list {
  523. max-height: calc(
  524. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @margin-md
  525. );
  526. }
  527. #dropdown-files-logs-pane-list {
  528. max-height: calc(
  529. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @btn-small-height ~' - '
  530. @margin-md
  531. );
  532. }
  533. .toolbar-pdf-expand-btn {
  534. .btn-inline-link;
  535. margin-left: @margin-xs;
  536. color: @toolbar-icon-btn-color;
  537. border-radius: @border-radius-small;
  538. &:hover {
  539. color: @toolbar-icon-btn-hover-color;
  540. }
  541. &:active {
  542. background-color: @link-color;
  543. color: #fff;
  544. }
  545. &:focus {
  546. outline: 0;
  547. color: #fff;
  548. }
  549. }
  550. .pdf-error-alert {
  551. position: absolute;
  552. width: 100%;
  553. height: 100%;
  554. background-color: @pdf-bg;
  555. padding: @line-height-computed / 2;
  556. }
  557. .pdf-loading-spinner-container {
  558. width: 100%;
  559. height: 100%;
  560. display: flex;
  561. align-items: center;
  562. justify-content: center;
  563. }