pdf.less 10 KB

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