pdf.less 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  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. display: flex;
  21. align-items: center;
  22. align-self: stretch;
  23. flex: 1 1 100%;
  24. }
  25. .toolbar-pdf-left when (@is-new-css = true) {
  26. margin-left: 2px;
  27. }
  28. .toolbar-pdf-right {
  29. flex: 1 0 auto;
  30. }
  31. .toolbar-pdf-orphan {
  32. justify-content: center;
  33. color: @toolbar-btn-color;
  34. .btn {
  35. margin-left: @margin-xs;
  36. }
  37. }
  38. .btn-toggle-logs {
  39. &:focus,
  40. &:active:focus {
  41. outline: none;
  42. }
  43. }
  44. .btn-toggle-logs-label {
  45. padding-left: @line-height-computed / 4;
  46. }
  47. .toolbar-pdf-hybrid {
  48. .btn:not(.detach-compile-button):not(.btn-orphan):not(.detach-synctex-control):not(.switch-to-editor-btn):not(.split-menu-dropdown-toggle):not(.split-menu-button) {
  49. display: inline-block;
  50. color: @toolbar-btn-color;
  51. background-color: transparent;
  52. padding: 4px 2px;
  53. line-height: 1;
  54. height: 24px;
  55. border-radius: 2px;
  56. &:hover,
  57. &:active,
  58. &:focus {
  59. color: @toolbar-btn-color;
  60. }
  61. .label {
  62. position: absolute;
  63. top: 0;
  64. right: 0;
  65. padding: 0.15em 0.6em 0.2em;
  66. font-size: 60%;
  67. pointer-events: none;
  68. }
  69. .btn {
  70. display: inline-block;
  71. color: #fff;
  72. background-color: transparent;
  73. padding: 4px 2px;
  74. line-height: 1;
  75. height: 24px;
  76. border-radius: 2px;
  77. }
  78. &.log-btn {
  79. border: none;
  80. margin-right: 3px;
  81. &.active {
  82. color: white;
  83. background-color: @link-color;
  84. box-shadow: @toolbar-icon-btn-hover-boxshadow;
  85. opacity: 0.65;
  86. &:hover {
  87. color: white;
  88. }
  89. }
  90. &:focus {
  91. outline: none;
  92. }
  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. .pdfjs-controls {
  188. position: absolute;
  189. padding: @line-height-computed / 2;
  190. top: 0;
  191. left: 0;
  192. display: inline-block;
  193. z-index: 10; // above the PDF viewer
  194. .btn-group {
  195. transition: opacity 0.5s ease, visibility 0 linear 0.5s;
  196. visibility: hidden;
  197. opacity: 0;
  198. }
  199. &:focus-within,
  200. &:hover {
  201. // make .pdfjs-controls and its children visible when it or any of its descendants are focused
  202. .btn-group {
  203. transition: none;
  204. visibility: visible;
  205. opacity: 1;
  206. }
  207. }
  208. &:hover,
  209. &.flash {
  210. .btn-group {
  211. transition: none;
  212. visibility: visible;
  213. opacity: 1;
  214. }
  215. }
  216. i.fa-arrows-h when(@is-new-css = false) {
  217. border-right: 2px solid white;
  218. border-left: 2px solid white;
  219. }
  220. i.fa-arrows-h when(@is-new-css = true) {
  221. border-right: 2px solid @content-primary;
  222. border-left: 2px solid @content-primary;
  223. }
  224. i.fa-arrows-v when(@is-new-css = false) {
  225. border-top: 2px solid white;
  226. border-bottom: 2px solid white;
  227. }
  228. i.fa-arrows-v when(@is-new-css = true) {
  229. border-top: 2px solid @content-primary;
  230. border-bottom: 2px solid @content-primary;
  231. }
  232. }
  233. }
  234. // The new viewer UI has overflow on the inner element,
  235. // so disable the overflow on the outer element
  236. .pdf-viewer .pdfjs-viewer.pdfjs-viewer-outer {
  237. overflow: hidden;
  238. }
  239. .pdf-logs {
  240. overflow: auto;
  241. .alert {
  242. font-size: 0.9rem;
  243. margin-bottom: @line-height-computed / 2;
  244. cursor: pointer;
  245. .line-no {
  246. float: right;
  247. color: @log-line-no-color;
  248. font-weight: 700;
  249. .fa {
  250. opacity: 0;
  251. }
  252. }
  253. .entry-message {
  254. font-weight: 700;
  255. //font-family: @font-family-monospace;
  256. }
  257. .entry-content {
  258. white-space: pre-wrap;
  259. font-size: 0.8rem;
  260. //font-family: @font-family-monospace;
  261. }
  262. &:hover .line-no {
  263. color: inherit;
  264. .fa {
  265. opacity: 1;
  266. }
  267. }
  268. &.alert-danger {
  269. background-color: tint(@alert-danger-bg, 15%);
  270. &:hover {
  271. background-color: @alert-danger-bg;
  272. }
  273. }
  274. &.alert-warning {
  275. background-color: tint(@alert-warning-bg, 15%);
  276. &:hover {
  277. background-color: @alert-warning-bg;
  278. }
  279. }
  280. &.alert-info {
  281. background-color: tint(@alert-info-bg, 15%);
  282. &:hover {
  283. background-color: @alert-info-bg;
  284. }
  285. }
  286. }
  287. pre {
  288. font-size: 12px;
  289. white-space: pre-wrap;
  290. }
  291. .dropdown {
  292. position: relative;
  293. }
  294. .force-recompile {
  295. margin-top: 10px;
  296. text-align: right;
  297. }
  298. }
  299. .synctex-controls {
  300. margin-right: -8px;
  301. position: absolute;
  302. z-index: @synctex-controls-z-index;
  303. padding: @synctex-controls-padding;
  304. top: 68px;
  305. }
  306. .synctex-control:not(.detach-synctex-control) {
  307. @ol-synctex-control-size: 24px;
  308. align-items: center;
  309. display: flex;
  310. justify-content: center;
  311. font-size: 1em;
  312. margin-bottom: @ol-synctex-control-size / 2;
  313. width: @ol-synctex-control-size;
  314. height: @ol-synctex-control-size;
  315. border-radius: @ol-synctex-control-size / 2;
  316. padding: 0 0 2px;
  317. background-color: fade(@btn-default-bg, 80%);
  318. transition: background 0.15s ease;
  319. color: white;
  320. border-color: transparent;
  321. &:focus:not(:focus-visible) {
  322. outline: none;
  323. }
  324. &[disabled] {
  325. opacity: 1;
  326. background-color: fade(@btn-default-bg, 60%);
  327. }
  328. }
  329. .synctex-control {
  330. > .synctex-control-icon {
  331. display: inline-block;
  332. font: normal normal normal 14px/1 FontAwesome;
  333. font-size: inherit;
  334. text-rendering: auto;
  335. -webkit-font-smoothing: antialiased;
  336. -moz-osx-font-smoothing: grayscale;
  337. }
  338. > .synctex-spin-icon {
  339. margin-top: 2px;
  340. }
  341. }
  342. .synctex-control-goto-pdf > .synctex-control-icon {
  343. text-indent: 1px; // "Optical" adjustment.
  344. &::before {
  345. content: '\f061';
  346. }
  347. }
  348. .synctex-control-goto-code > .synctex-control-icon {
  349. text-indent: -1px; // "Optical" adjustment.
  350. &::before {
  351. content: '\f060';
  352. }
  353. }
  354. .editor-dark {
  355. .pdf-logs {
  356. background-color: lighten(@editor-dark-background-color, 10%);
  357. }
  358. .pdfjs-viewer {
  359. background-color: lighten(@editor-dark-background-color, 10%);
  360. }
  361. .pdf .toolbar {
  362. .toolbar-right a {
  363. i {
  364. border-color: @gray;
  365. }
  366. &:hover {
  367. i {
  368. border-color: @gray-light;
  369. }
  370. }
  371. }
  372. }
  373. }
  374. .keyboard-tooltip {
  375. .tooltip-inner {
  376. max-width: none;
  377. }
  378. }
  379. .keyboard-shortcut {
  380. white-space: nowrap;
  381. }
  382. @keyframes expand-feedback-area {
  383. from {
  384. max-height: 0;
  385. }
  386. to {
  387. max-height: 500px;
  388. }
  389. }
  390. .card-hint:extend(.card-thin) {
  391. margin-top: 10px;
  392. padding-bottom: 7px;
  393. cursor: default;
  394. &-icon-container {
  395. background: currentColor;
  396. width: 2.5rem;
  397. height: 2.5rem;
  398. font-size: 1.5rem;
  399. text-align: center;
  400. border-radius: 50%;
  401. float: left;
  402. margin-right: 10px;
  403. .fa {
  404. color: #fff;
  405. }
  406. .alert-danger & {
  407. color: @state-danger-border;
  408. }
  409. .alert-warning & {
  410. color: @state-warning-border;
  411. }
  412. .alert-info & {
  413. color: @state-info-border;
  414. }
  415. }
  416. &-text,
  417. &-feedback-label {
  418. color: @log-hints-color;
  419. font-size: 0.9rem;
  420. margin-bottom: 20px;
  421. }
  422. &-text {
  423. min-height: 35px;
  424. }
  425. &-feedback-label {
  426. font-size: inherit;
  427. margin-right: 0.5em;
  428. margin-bottom: 0;
  429. font-weight: normal;
  430. }
  431. &-ext-link,
  432. &-feedback {
  433. display: inline-block;
  434. font-size: 0.8rem;
  435. }
  436. &-footer a,
  437. &-text a {
  438. .alert-danger & {
  439. color: @state-danger-text;
  440. }
  441. .alert-warning & {
  442. color: @state-warning-text;
  443. }
  444. .alert-info & {
  445. color: @state-info-text;
  446. }
  447. }
  448. &-feedback {
  449. color: @log-hints-color;
  450. float: right;
  451. }
  452. &-extra-feedback {
  453. color: @log-hints-color;
  454. font-size: 0.8rem;
  455. margin-top: 10px;
  456. padding-bottom: 5px;
  457. animation: 0.5s ease-out expand-feedback-area;
  458. overflow: hidden;
  459. &-label {
  460. margin: 5px 0 10px;
  461. padding-top: 5px;
  462. border-top: solid 1px @gray-lighter;
  463. }
  464. .radio {
  465. margin: 5px;
  466. }
  467. textarea {
  468. font-size: 0.8rem;
  469. margin-bottom: 10px;
  470. padding: 5px;
  471. }
  472. input[type='radio'] {
  473. margin-top: 2px;
  474. }
  475. }
  476. & + p {
  477. margin-top: 20px;
  478. }
  479. }
  480. .files-dropdown-container {
  481. .pull-right();
  482. position: relative;
  483. }
  484. .files-dropdown {
  485. display: inline-block;
  486. }
  487. .plv-text-layer {
  488. display: none;
  489. user-select: text;
  490. .pdf-page-container:hover &,
  491. .pdfjs-viewer-show-text & {
  492. display: block;
  493. }
  494. }
  495. @editor-and-logs-pane-toolbars-height: @toolbar-small-height + @toolbar-height;
  496. @btn-small-height: (@padding-small-vertical * 2)+ (@font-size-small *
  497. @line-height-small);
  498. #download-dropdown-list,
  499. #dropdown-files-logs-pane-list {
  500. overflow-y: auto;
  501. .dropdown-header {
  502. white-space: nowrap;
  503. }
  504. }
  505. #download-dropdown-list {
  506. max-height: calc(
  507. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @margin-md
  508. );
  509. }
  510. #dropdown-files-logs-pane-list {
  511. max-height: calc(
  512. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @btn-small-height ~' - '
  513. @margin-md
  514. );
  515. }
  516. .pdf-loading-spinner-container {
  517. width: 100%;
  518. height: 100%;
  519. display: flex;
  520. align-items: center;
  521. justify-content: center;
  522. }
  523. .btn-secondary-compile-timeout-override {
  524. color: #1b222c;
  525. background-color: #ffffff;
  526. border-color: #677283;
  527. border-width: 1px;
  528. }