pdf.less 11 KB

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