pdf.less 11 KB

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