pdf.less 11 KB

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