pdf.less 10 KB

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