pdf.less 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. @stripe-width: 20px;
  2. @keyframes pdf-toolbar-stripes {
  3. from {
  4. background-position: 0 0;
  5. }
  6. to {
  7. background-position: @stripe-width 0;
  8. }
  9. }
  10. .pdf .toolbar.toolbar-pdf {
  11. .toolbar-small-mixin;
  12. .toolbar-alt-mixin;
  13. padding-right: 5px;
  14. &.changes-to-autocompile {
  15. #gradient > .striped(@color: rgba(255, 255, 255, 0.1), @angle: -45deg);
  16. background-size: @stripe-width @stripe-width;
  17. .animation(pdf-toolbar-stripes 2s linear infinite);
  18. }
  19. .auto-compile-status {
  20. color: white;
  21. margin-right: (@line-height-computed / 2);
  22. i {
  23. color: @brand-danger;
  24. }
  25. }
  26. .auto-compile-status when (@is-overleaf-light = true) {
  27. color: @ol-blue-gray-3;
  28. }
  29. }
  30. .pdf .toolbar.toolbar-pdf when (@is-overleaf-light = false) {
  31. border-bottom: 0;
  32. }
  33. .toolbar-pdf-left,
  34. .toolbar-pdf-right {
  35. display: flex;
  36. align-items: center;
  37. align-self: stretch;
  38. flex: 1 1 100%;
  39. }
  40. .toolbar-pdf-right {
  41. flex: 1 0 auto;
  42. }
  43. .btn-toggle-logs {
  44. &:focus,
  45. &:active:focus {
  46. outline: none;
  47. }
  48. }
  49. .btn-toggle-logs-label {
  50. padding-left: @line-height-computed / 4;
  51. }
  52. .pdf {
  53. background-color: @pdf-bg;
  54. }
  55. .pdf-viewer,
  56. .pdf-logs,
  57. .pdf-errors,
  58. .pdf-uncompiled {
  59. .full-size;
  60. top: @pdf-top-offset;
  61. }
  62. .pdf-logs,
  63. .pdf-errors,
  64. .pdf-uncompiled,
  65. .pdf-validation-problems {
  66. padding: @line-height-computed / 2;
  67. }
  68. .pdf-uncompiled {
  69. .fa {
  70. color: @blue;
  71. }
  72. }
  73. .btn-recompile-group {
  74. align-self: stretch;
  75. margin-right: 6px;
  76. .btn-recompile {
  77. height: 100%;
  78. .btn-primary;
  79. padding-top: 3px;
  80. padding-bottom: 3px;
  81. &:first-child {
  82. border-top-left-radius: 0;
  83. border-bottom-left-radius: 0;
  84. }
  85. &[disabled] {
  86. background-color: mix(@btn-primary-bg, @toolbar-alt-bg-color, 65%);
  87. .opacity(1);
  88. }
  89. }
  90. }
  91. .btn-recompile-label {
  92. margin-left: @line-height-computed / 4;
  93. }
  94. .pdf-viewer {
  95. iframe {
  96. width: 100%;
  97. height: 100%;
  98. border: none;
  99. }
  100. .pdfjs-viewer {
  101. .full-size;
  102. background-color: @pdfjs-bg;
  103. overflow: scroll;
  104. canvas,
  105. div.pdf-canvas {
  106. background: white;
  107. box-shadow: @pdf-page-shadow-color 0px 0px 10px;
  108. }
  109. div.pdf-canvas.pdfng-empty {
  110. background-color: white;
  111. }
  112. div.pdf-canvas.pdfng-loading {
  113. background-color: white;
  114. }
  115. .page-container {
  116. margin: 10px auto;
  117. padding: 0 10px;
  118. box-sizing: content-box;
  119. user-select: none;
  120. }
  121. }
  122. .progress-thin {
  123. position: absolute;
  124. top: -2px;
  125. height: 3px;
  126. left: 0;
  127. right: 0;
  128. .progress-bar {
  129. height: 100%;
  130. background-color: @link-color;
  131. }
  132. }
  133. .pdfjs-controls {
  134. position: absolute;
  135. padding: @line-height-computed / 2;
  136. top: 0;
  137. left: 0;
  138. display: inline-block;
  139. .btn-group {
  140. transition: opacity 0.5s ease, visibility 0 linear 0.5s;
  141. visibility: hidden;
  142. opacity: 0;
  143. }
  144. &:hover,
  145. &.flash {
  146. .btn-group {
  147. transition: none;
  148. visibility: visible;
  149. opacity: 1;
  150. }
  151. }
  152. i.fa-arrows-h {
  153. border-right: 2px solid white;
  154. border-left: 2px solid white;
  155. }
  156. i.fa-arrows-v {
  157. border-top: 2px solid white;
  158. border-bottom: 2px solid white;
  159. }
  160. }
  161. }
  162. .pdf-logs {
  163. overflow: auto;
  164. .alert {
  165. font-size: 0.9rem;
  166. margin-bottom: @line-height-computed / 2;
  167. cursor: pointer;
  168. .line-no {
  169. float: right;
  170. color: @log-line-no-color;
  171. font-weight: 700;
  172. .fa {
  173. opacity: 0;
  174. }
  175. }
  176. .entry-message {
  177. font-weight: 700;
  178. //font-family: @font-family-monospace;
  179. }
  180. .entry-content {
  181. white-space: pre-wrap;
  182. font-size: 0.8rem;
  183. //font-family: @font-family-monospace;
  184. }
  185. &:hover .line-no {
  186. color: inherit;
  187. .fa {
  188. opacity: 1;
  189. }
  190. }
  191. &.alert-danger {
  192. background-color: tint(@alert-danger-bg, 15%);
  193. &:hover {
  194. background-color: @alert-danger-bg;
  195. }
  196. }
  197. &.alert-warning {
  198. background-color: tint(@alert-warning-bg, 15%);
  199. &:hover {
  200. background-color: @alert-warning-bg;
  201. }
  202. }
  203. &.alert-info {
  204. background-color: tint(@alert-info-bg, 15%);
  205. &:hover {
  206. background-color: @alert-info-bg;
  207. }
  208. }
  209. }
  210. pre {
  211. font-size: 12px;
  212. }
  213. .dropdown {
  214. position: relative;
  215. }
  216. .force-recompile {
  217. margin-top: 10px;
  218. text-align: right;
  219. }
  220. }
  221. .synctex-controls {
  222. margin-right: -8px;
  223. position: absolute;
  224. z-index: @synctex-controls-z-index;
  225. padding: @synctex-controls-padding;
  226. top: 68px;
  227. }
  228. .synctex-control {
  229. @ol-synctex-control-size: 24px;
  230. align-items: center;
  231. display: flex;
  232. justify-content: center;
  233. font-size: 1em;
  234. margin-bottom: @ol-synctex-control-size / 2;
  235. width: @ol-synctex-control-size;
  236. height: @ol-synctex-control-size;
  237. border-radius: @ol-synctex-control-size / 2;
  238. padding: 0 0 2px;
  239. background-color: fade(@btn-default-bg, 80%);
  240. transition: background 0.15s ease;
  241. &[disabled] {
  242. opacity: 1;
  243. background-color: fade(@btn-default-bg, 60%);
  244. }
  245. > .synctex-control-icon {
  246. display: inline-block;
  247. font: normal normal normal 14px/1 FontAwesome;
  248. font-size: inherit;
  249. text-rendering: auto;
  250. -webkit-font-smoothing: antialiased;
  251. -moz-osx-font-smoothing: grayscale;
  252. }
  253. > .synctex-spin-icon {
  254. margin-top: 2px;
  255. }
  256. }
  257. .synctex-control-goto-pdf > .synctex-control-icon {
  258. text-indent: 1px; // "Optical" adjustment.
  259. &::before {
  260. content: '\f061';
  261. }
  262. }
  263. .synctex-control-goto-code > .synctex-control-icon {
  264. text-indent: -1px; // "Optical" adjustment.
  265. &::before {
  266. content: '\f060';
  267. }
  268. }
  269. .editor-dark {
  270. .pdf-logs {
  271. background-color: lighten(@editor-dark-background-color, 10%);
  272. }
  273. .pdfjs-viewer {
  274. background-color: lighten(@editor-dark-background-color, 10%);
  275. }
  276. .pdf .toolbar {
  277. .toolbar-right a {
  278. i {
  279. border-color: @gray;
  280. }
  281. &:hover {
  282. i {
  283. border-color: @gray-light;
  284. }
  285. }
  286. }
  287. }
  288. }
  289. .keyboard-tooltip {
  290. .tooltip-inner {
  291. max-width: none;
  292. }
  293. }
  294. .keyboard-shortcut {
  295. white-space: nowrap;
  296. }
  297. @keyframes expand-feedback-area {
  298. from {
  299. max-height: 0;
  300. }
  301. to {
  302. max-height: 500px;
  303. }
  304. }
  305. .card-hint:extend(.card-thin) {
  306. margin-top: 10px;
  307. padding-bottom: 7px;
  308. cursor: default;
  309. &-icon-container {
  310. background: currentColor;
  311. width: 2.5rem;
  312. height: 2.5rem;
  313. font-size: 1.5rem;
  314. text-align: center;
  315. border-radius: 50%;
  316. float: left;
  317. margin-right: 10px;
  318. .fa {
  319. color: #fff;
  320. }
  321. .alert-danger & {
  322. color: @state-danger-border;
  323. }
  324. .alert-warning & {
  325. color: @state-warning-border;
  326. }
  327. .alert-info & {
  328. color: @state-info-border;
  329. }
  330. }
  331. &-text,
  332. &-feedback-label {
  333. color: @log-hints-color;
  334. font-size: 0.9rem;
  335. margin-bottom: 20px;
  336. }
  337. &-text {
  338. min-height: 35px;
  339. }
  340. &-feedback-label {
  341. font-size: inherit;
  342. margin-right: 0.5em;
  343. margin-bottom: 0;
  344. font-weight: normal;
  345. }
  346. &-ext-link,
  347. &-feedback {
  348. display: inline-block;
  349. font-size: 0.8rem;
  350. }
  351. &-footer a,
  352. &-text a {
  353. .alert-danger & {
  354. color: @state-danger-text;
  355. }
  356. .alert-warning & {
  357. color: @state-warning-text;
  358. }
  359. .alert-info & {
  360. color: @state-info-text;
  361. }
  362. }
  363. &-feedback {
  364. color: @log-hints-color;
  365. float: right;
  366. }
  367. &-extra-feedback {
  368. color: @log-hints-color;
  369. font-size: 0.8rem;
  370. margin-top: 10px;
  371. padding-bottom: 5px;
  372. animation: 0.5s ease-out expand-feedback-area;
  373. overflow: hidden;
  374. &-label {
  375. margin: 5px 0 10px;
  376. padding-top: 5px;
  377. border-top: solid 1px @gray-lighter;
  378. }
  379. .radio {
  380. margin: 5px;
  381. }
  382. textarea {
  383. font-size: 0.8rem;
  384. margin-bottom: 10px;
  385. padding: 5px;
  386. }
  387. input[type='radio'] {
  388. margin-top: 2px;
  389. }
  390. }
  391. & + p {
  392. margin-top: 20px;
  393. }
  394. }
  395. .files-dropdown-container {
  396. .pull-right();
  397. position: relative;
  398. }
  399. .files-dropdown {
  400. display: inline-block;
  401. }
  402. .plv-text-layer {
  403. display: none;
  404. user-select: text;
  405. .pdf-page-container:hover &,
  406. .pdfjs-viewer-show-text & {
  407. display: block;
  408. }
  409. }
  410. #download-dropdown-list {
  411. max-height: calc(
  412. ~'100vh - ' @toolbar-small-height ~' - ' @toolbar-height ~' - ' @margin-md
  413. );
  414. overflow-y: auto;
  415. }