pdf.less 11 KB

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