pdf.less 11 KB

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