pdf.less 11 KB

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