pdf.less 11 KB

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