pdf.less 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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(.detach-synctex-control):not(.switch-to-editor-btn):not(.split-menu-dropdown-toggle):not(.split-menu-button) {
  46. display: inline-block;
  47. color: @toolbar-btn-color;
  48. background-color: transparent;
  49. padding: 4px 2px;
  50. line-height: 1;
  51. height: 24px;
  52. border-radius: 2px;
  53. &:hover,
  54. &:active,
  55. &:focus {
  56. color: @toolbar-btn-color;
  57. }
  58. .label {
  59. position: absolute;
  60. top: 0;
  61. right: 0;
  62. padding: 0.15em 0.6em 0.2em;
  63. font-size: 60%;
  64. pointer-events: none;
  65. }
  66. .btn {
  67. display: inline-block;
  68. color: #fff;
  69. background-color: transparent;
  70. padding: 4px 2px;
  71. line-height: 1;
  72. height: 24px;
  73. border-radius: 2px;
  74. }
  75. &.log-btn {
  76. border: none;
  77. margin-right: 3px;
  78. &.active {
  79. color: white;
  80. background-color: @link-color;
  81. box-shadow: @toolbar-icon-btn-hover-boxshadow;
  82. opacity: 0.65;
  83. &:hover {
  84. color: white;
  85. }
  86. }
  87. &:focus {
  88. outline: none;
  89. }
  90. }
  91. }
  92. }
  93. .pdf {
  94. background-color: @pdf-bg;
  95. }
  96. .pdf-viewer,
  97. .pdf-logs,
  98. .pdf-errors,
  99. .pdf-uncompiled {
  100. .full-size;
  101. top: @pdf-top-offset;
  102. }
  103. .pdf-logs,
  104. .pdf-errors,
  105. .pdf-uncompiled,
  106. .pdf-validation-problems {
  107. padding: @line-height-computed / 2;
  108. }
  109. .pdf-uncompiled {
  110. .fa {
  111. color: @blue;
  112. }
  113. }
  114. .toolbar-text {
  115. padding-left: @padding-xs;
  116. }
  117. .pdf-viewer {
  118. iframe {
  119. width: 100%;
  120. height: 100%;
  121. border: none;
  122. }
  123. .pdfjs-viewer {
  124. .full-size;
  125. background-color: @pdfjs-bg;
  126. overflow: scroll;
  127. .canvasWrapper > canvas,
  128. div.pdf-canvas {
  129. background: white;
  130. box-shadow: @pdf-page-shadow-color 0px 0px 10px;
  131. }
  132. div.pdf-canvas.pdfng-empty {
  133. background-color: white;
  134. }
  135. div.pdf-canvas.pdfng-loading {
  136. background-color: white;
  137. }
  138. .page-container {
  139. margin: 10px auto;
  140. padding: 0 10px;
  141. box-sizing: content-box;
  142. user-select: none;
  143. }
  144. .page {
  145. box-sizing: content-box;
  146. margin-left: auto;
  147. margin-right: auto;
  148. box-shadow: 0 0 8px #bbb;
  149. border: none;
  150. margin-top: 10px;
  151. margin-bottom: 10px;
  152. }
  153. .pdfjs-viewer-inner {
  154. position: absolute;
  155. overflow-y: scroll;
  156. width: 100%;
  157. height: 100%;
  158. -webkit-font-smoothing: initial;
  159. -moz-osx-font-smoothing: initial;
  160. /* fix review-panel overflow issue, see: https://github.com/overleaf/internal/issues/6781#issuecomment-1112708638 */
  161. .pdfViewer {
  162. min-height: 100%;
  163. }
  164. }
  165. &:focus-within {
  166. outline: none;
  167. }
  168. /* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */
  169. .textLayer br::selection {
  170. background: transparent;
  171. }
  172. }
  173. .progress-thin {
  174. position: absolute;
  175. top: -2px;
  176. height: 3px;
  177. left: 0;
  178. right: 0;
  179. .progress-bar {
  180. height: 100%;
  181. background-color: @link-color;
  182. }
  183. }
  184. .pdfjs-controls {
  185. position: absolute;
  186. padding: @line-height-computed / 2;
  187. top: 0;
  188. left: 0;
  189. display: inline-block;
  190. z-index: 10; // above the PDF viewer
  191. .btn-group {
  192. transition: opacity 0.5s ease, visibility 0 linear 0.5s;
  193. visibility: hidden;
  194. opacity: 0;
  195. }
  196. &:focus-within,
  197. &:hover {
  198. // make .pdfjs-controls and its children visible when it or any of its descendants are focused
  199. .btn-group {
  200. transition: none;
  201. visibility: visible;
  202. opacity: 1;
  203. }
  204. }
  205. &:hover,
  206. &.flash {
  207. .btn-group {
  208. transition: none;
  209. visibility: visible;
  210. opacity: 1;
  211. }
  212. }
  213. i.fa-arrows-h {
  214. border-right: 2px solid @content-primary;
  215. border-left: 2px solid @content-primary;
  216. }
  217. i.fa-arrows-v {
  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. @editor-and-logs-pane-toolbars-height: @toolbar-small-height + @toolbar-height;
  477. @btn-small-height: (@padding-small-vertical * 2)+ (@font-size-small *
  478. @line-height-small);
  479. #download-dropdown-list,
  480. #dropdown-files-logs-pane-list {
  481. overflow-y: auto;
  482. .dropdown-header {
  483. white-space: nowrap;
  484. }
  485. }
  486. #download-dropdown-list {
  487. max-height: calc(
  488. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @margin-md
  489. );
  490. }
  491. #dropdown-files-logs-pane-list {
  492. max-height: calc(
  493. ~'100vh - ' @editor-and-logs-pane-toolbars-height ~' - ' @btn-small-height ~' - '
  494. @margin-md
  495. );
  496. }
  497. .btn-secondary-compile-timeout-override {
  498. color: #1b222c;
  499. background-color: #ffffff;
  500. border-color: #677283;
  501. border-width: 1px;
  502. }